Skip to content

Commit 8acaaa9

Browse files
committed
Rollup merge of rust-lang#22351 - blaenk:path-hash, r=huonw
`PathBuf` does implement `Hash`, but `Path` doesn't. This makes it annoying if you have a `HashMap` with `PathBuf`s as keys, because it means you have to convert a `Path` into a `PathBuf` and get a reference to it simply to perform operations on the `HashMap`!
2 parents c59f62b + 10dd8e7 commit 8acaaa9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libstd/path.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@ impl AsOsStr for PathBuf {
10331033
/// let parent_dir = path.parent();
10341034
/// ```
10351035
///
1036+
#[derive(Hash)]
10361037
pub struct Path {
10371038
inner: OsStr
10381039
}

0 commit comments

Comments
 (0)