diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-06 21:29:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-06 21:29:31 +0200 |
| commit | 09de71b61c931af799b064e4c377ffecf78b6ad7 (patch) | |
| tree | ee59b4a608d6dfbe27afa2d867ab393a8e821b83 /library/std/src | |
| parent | de6c639228a8fdadfb2b7b0d4c7ef80848d3643d (diff) | |
| parent | d8e8a5e8b4867cdc48b98c0126807267a6258e70 (diff) | |
| download | rust-09de71b61c931af799b064e4c377ffecf78b6ad7.tar.gz rust-09de71b61c931af799b064e4c377ffecf78b6ad7.zip | |
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 rust-lang/rust#144870
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/path.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 055e7f81480..e7ba6936435 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2683,6 +2683,8 @@ impl Path { /// /// assert_eq!("foo", Path::new("foo.rs").file_prefix().unwrap()); /// assert_eq!("foo", Path::new("foo.tar.gz").file_prefix().unwrap()); + /// assert_eq!(".config", Path::new(".config").file_prefix().unwrap()); + /// assert_eq!(".config", Path::new(".config.toml").file_prefix().unwrap()); /// ``` /// /// # See Also |
