File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1278,6 +1278,13 @@ impl Lookup<String> for &str {
12781278 }
12791279}
12801280
1281+ #[ cfg( feature = "compact_str" ) ]
1282+ impl Lookup < compact_str:: CompactString > for & str {
1283+ fn into_owned ( self ) -> compact_str:: CompactString {
1284+ compact_str:: CompactString :: new ( self )
1285+ }
1286+ }
1287+
12811288impl HashEqLike < & str > for String {
12821289 fn hash < H : Hasher > ( & self , h : & mut H ) {
12831290 Hash :: hash ( self , & mut * h)
@@ -1288,6 +1295,17 @@ impl HashEqLike<&str> for String {
12881295 }
12891296}
12901297
1298+ #[ cfg( feature = "compact_str" ) ]
1299+ impl HashEqLike < & str > for compact_str:: CompactString {
1300+ fn hash < H : Hasher > ( & self , h : & mut H ) {
1301+ Hash :: hash ( self , & mut * h)
1302+ }
1303+
1304+ fn eq ( & self , data : & & str ) -> bool {
1305+ self == * data
1306+ }
1307+ }
1308+
12911309impl < A , T : Hash + Eq + PartialEq < A > > HashEqLike < & [ A ] > for Vec < T > {
12921310 fn hash < H : Hasher > ( & self , h : & mut H ) {
12931311 Hash :: hash ( self , h) ;
You can’t perform that action at this time.
0 commit comments