Fix underflow bugs, silent error, dead code, and path sanitization#38
Merged
Fix underflow bugs, silent error, dead code, and path sanitization#38
Conversation
Use saturating_sub for scroll state when details are empty, and add early returns in next()/previous() for empty lists to prevent panics.
Return an error when new passwords don't match instead of silently succeeding without changing anything.
Remove unused popup: bool field from App (popup state is tracked via key_details). Fix "it will be able" -> "it will be available".
Move space replacement into sanitize_for_path so callers don't need
to remember the extra .replace(" ", "") step. Update mirrored helper
in tests accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
saturating_sub(1)for scroll state when details are empty, and add early returns innext()/previous()for empty lists to prevent panicsedit_passwordnow returns an error when new passwords don't match instead of silently succeedingpopupfield and fix typo: Remove unusedpopup: boolfromApp, fix "it will be able" → "it will be available" in help textsanitize_for_path: Move space replacement into the helper so callers don't need a separate.replace(" ", "")step