Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support truly unlimited re-entries #1472

Open
ctm opened this issue Jul 16, 2024 · 0 comments
Open

Support truly unlimited re-entries #1472

ctm opened this issue Jul 16, 2024 · 0 comments
Assignees
Labels
chore Maintenance or other non-bug, non-feature easy Trivial to do (even when tired!) and semi-worthwhile

Comments

@ctm
Copy link
Owner

ctm commented Jul 16, 2024

FInish support for unlimited re-entries.

Internally, we already have the following code, which shows that I had initially started to add support for true unlimited re-entries, but I half-assed it.

impl From<crate::structure::ReEntryInfo> for ReEntryInfo {
    fn from(value: crate::structure::ReEntryInfo) -> Self {
        Self {
            last_re_entry_round: value.last_re_entry_level.into(),
            re_entries: value.max_n_re_entries.unwrap_or_else(|| {
                log::warn!("unlimited re-entries not well supported");
                NonZeroU8::new(u8::MAX).unwrap()
            }),
        }
    }
}

The above is super embarrassing, because not only do we have two different ReEntryInfo types, one uses max_n_re_entries as an Option<u8> where None represents "there is no max", i.e. unlimited, but the other is simply a u8. That's a recipe for disaster and that's largely what bit us yesterday (#1470).

The fix isn't hard, per-se, and rust will hold my hand while I do it, but I am not marking this high priority, because I'm not convinced that I should do this for the remaining WYWAB events, when I can do something else quicker, first (#1471).

@ctm ctm added chore Maintenance or other non-bug, non-feature easy Trivial to do (even when tired!) and semi-worthwhile labels Jul 16, 2024
@ctm ctm self-assigned this Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance or other non-bug, non-feature easy Trivial to do (even when tired!) and semi-worthwhile
Projects
None yet
Development

No branches or pull requests

1 participant