diff options
Diffstat (limited to 'library/std/src/path.rs')
| -rw-r--r-- | library/std/src/path.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 9ab2f045d69..8a2450fcb88 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2217,9 +2217,7 @@ impl Path { /// #[unstable(feature = "path_file_prefix", issue = "86319")] pub fn file_prefix(&self) -> Option<&OsStr> { - self.file_name() - .map(split_file_at_dot) - .and_then(|(before, after)| if before.is_empty() { after } else { Some(before) }) + self.file_name().map(split_file_at_dot).and_then(|(before, _after)| Some(before)) } /// Extracts the extension of [`self.file_name`], if possible. |
