Rollup merge of #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`!
This commit is contained in:
commit
8acaaa9e0e
@ -1033,6 +1033,7 @@ impl AsOsStr for PathBuf {
|
||||
/// let parent_dir = path.parent();
|
||||
/// ```
|
||||
///
|
||||
#[derive(Hash)]
|
||||
pub struct Path {
|
||||
inner: OsStr
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user