Skip to content

refactor: make three invariant re-checks structural - #1168

Open
kronberger-droid wants to merge 4 commits into
nushell:mainfrom
kronberger-droid:refactor/small-panic-sites
Open

refactor: make three invariant re-checks structural#1168
kronberger-droid wants to merge 4 commits into
nushell:mainfrom
kronberger-droid:refactor/small-panic-sites

Conversation

@kronberger-droid

Copy link
Copy Markdown
Collaborator

Summary

Three small sites from the panic-surface sweep, none a reachable panic in practice,
each a guard the type did not carry:

  • locate_word: WordKind::Unicode was handled by an early return above a match that then needed an unreachable! arm for it.
    The return now lives in the match, so three kinds are three arms.
  • end_of_line and coerce_crlf: both read bytes[i - 1] == b'\r' under an i > 0 guard.
    The guard stays for the subtraction; the read goes through get().

No public API change, no behaviour change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant