Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Klimenty Tsoutsman <[email protected]>
  • Loading branch information
tsoutsman committed Oct 21, 2023
1 parent e0dbfcd commit 256747e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/path/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl Path {
pub fn file_stem(&self) -> Option<&str> {
self.file_name().map(|name| match name.rsplit_once('.') {
Some((before, _)) => {
if before == "" {
if before.is_empty() {
// The file starts with a `.` and has no other `.`s within.
name
} else {
Expand Down Expand Up @@ -440,7 +440,7 @@ impl Path {
pub fn extension(&self) -> Option<&str> {
self.file_name()
.and_then(|file_name| file_name.rsplit_once('.'))
.and_then(|(before, after)| if before == "" { None } else { Some(after) })
.and_then(|(before, after)| if before.is_empty() { None } else { Some(after) })
}
}

Expand Down

0 comments on commit 256747e

Please sign in to comment.