Make it easier to convert strings to Id (#2350)

This commit is contained in:
Erlend Walstad 2022-11-27 13:15:18 +01:00 committed by GitHub
parent 502e1aa229
commit d2f70cdcd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,6 +85,13 @@ impl From<&'static str> for Id {
}
}
impl From<String> for Id {
#[inline]
fn from(string: String) -> Self {
Self::new(string)
}
}
// ----------------------------------------------------------------------------
// Idea taken from the `nohash_hasher` crate.