From 53b38e301ccf2bc78faa1935a3ec352666180ec8 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sat, 14 Sep 2019 22:06:13 -0400 Subject: [PATCH] Create collections/str --- src/{collections.rs => collections/mod.rs} | 2 ++ src/collections/str.rs | 7 +++++++ 2 files changed, 9 insertions(+) rename src/{collections.rs => collections/mod.rs} (98%) create mode 100644 src/collections/str.rs diff --git a/src/collections.rs b/src/collections/mod.rs similarity index 98% rename from src/collections.rs rename to src/collections/mod.rs index 2269f2ebd4..af88e75445 100644 --- a/src/collections.rs +++ b/src/collections/mod.rs @@ -1,5 +1,7 @@ use std::hash::BuildHasherDefault; +pub mod str; + pub use fxhash::FxHasher; #[inline(always)] diff --git a/src/collections/str.rs b/src/collections/str.rs new file mode 100644 index 0000000000..57542b099a --- /dev/null +++ b/src/collections/str.rs @@ -0,0 +1,7 @@ +pub struct Str(pub str); + +impl<'a> Into<&'a str> for &'a Str { + fn into(self) -> &'a str { + &self.0 + } +}