File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 1
- #![ no_std]
1
+ #![ cfg_attr ( not ( feature = "std" ) , no_std) ]
2
2
#![ cfg_attr( docsrs, feature( doc_auto_cfg) ) ]
3
3
4
4
extern crate alloc;
@@ -319,6 +319,29 @@ impl AsRef<str> for SmolStr {
319
319
}
320
320
}
321
321
322
+ impl AsRef < [ u8 ] > for SmolStr {
323
+ #[ inline( always) ]
324
+ fn as_ref ( & self ) -> & [ u8 ] {
325
+ self . as_str ( ) . as_bytes ( )
326
+ }
327
+ }
328
+
329
+ #[ cfg( feature = "std" ) ]
330
+ impl AsRef < std:: ffi:: OsStr > for SmolStr {
331
+ #[ inline( always) ]
332
+ fn as_ref ( & self ) -> & std:: ffi:: OsStr {
333
+ AsRef :: < std:: ffi:: OsStr > :: as_ref ( self . as_str ( ) )
334
+ }
335
+ }
336
+
337
+ #[ cfg( feature = "std" ) ]
338
+ impl AsRef < std:: path:: Path > for SmolStr {
339
+ #[ inline( always) ]
340
+ fn as_ref ( & self ) -> & std:: path:: Path {
341
+ AsRef :: < std:: path:: Path > :: as_ref ( self . as_str ( ) )
342
+ }
343
+ }
344
+
322
345
impl From < & str > for SmolStr {
323
346
#[ inline]
324
347
fn from ( s : & str ) -> SmolStr {
You can’t perform that action at this time.
0 commit comments