Skip to content

Commit 033326e

Browse files
authored
Unrolled build for #144972
Rollup merge of #144972 - the8472:file-prefix-docs, r=joshtriplett add code example showing that file_prefix treats dotfiles as the name of a file, not an extension This came up in a libs-api meeting while we were reviewing #144870
2 parents 7d82b83 + d8e8a5e commit 033326e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/path.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,6 +2683,8 @@ impl Path {
26832683
///
26842684
/// assert_eq!("foo", Path::new("foo.rs").file_prefix().unwrap());
26852685
/// assert_eq!("foo", Path::new("foo.tar.gz").file_prefix().unwrap());
2686+
/// assert_eq!(".config", Path::new(".config").file_prefix().unwrap());
2687+
/// assert_eq!(".config", Path::new(".config.toml").file_prefix().unwrap());
26862688
/// ```
26872689
///
26882690
/// # See Also

0 commit comments

Comments
 (0)