fix: replace panicking expect() with map_or() for file_name() check#2688
Open
srpatcha wants to merge 1 commit intomozilla:mainfrom
Open
fix: replace panicking expect() with map_or() for file_name() check#2688srpatcha wants to merge 1 commit intomozilla:mainfrom
srpatcha wants to merge 1 commit intomozilla:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2688 +/- ##
==========================================
+ Coverage 74.17% 74.33% +0.16%
==========================================
Files 70 70
Lines 39207 39372 +165
==========================================
+ Hits 29083 29269 +186
+ Misses 10124 10103 -21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Path::file_name() returns None for paths ending in '..' which caused a panic. Build cache tools should handle unusual paths gracefully. Signed-off-by: Srikanth Patchava <spatchava@meta.com> Signed-off-by: Srikanth Patchava <srpatcha@users.noreply.github.com>
69af502 to
7cb0568
Compare
Author
|
Hi, fixed the clippy \\diff
This is the canonical idiom and matches what clippy stable suggests. Force-pushed; CI should pass on ubuntu, macOS, and windows now. |
Collaborator
|
could you please add a test to make sure we don't regress in the future? thanks |
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
\Path::file_name()\ returns \None\ for paths ending in ..\ which caused a panic via .expect(). Replace with .map_or()\ to handle unusual paths gracefully.
This is split from #2679 per reviewer feedback to keep changes focused.
Changes
Signed-off-by: Srikanth Patchava spatchava@meta.com