File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ impl Buf {
150150
151151impl Slice {
152152 #[ inline]
153- pub fn from_str ( s : & str ) -> & Slice {
153+ pub const fn from_str ( s : & str ) -> & Slice {
154154 unsafe { mem:: transmute ( Wtf8 :: from_str ( s) ) }
155155 }
156156
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ impl Wtf8 {
507507 ///
508508 /// Since WTF-8 is a superset of UTF-8, this always succeeds.
509509 #[ inline]
510- pub fn from_str ( value : & str ) -> & Wtf8 {
510+ pub const fn from_str ( value : & str ) -> & Wtf8 {
511511 unsafe { Wtf8 :: from_bytes_unchecked ( value. as_bytes ( ) ) }
512512 }
513513
@@ -516,7 +516,7 @@ impl Wtf8 {
516516 /// Since the byte slice is not checked for valid WTF-8, this functions is
517517 /// marked unsafe.
518518 #[ inline]
519- unsafe fn from_bytes_unchecked ( value : & [ u8 ] ) -> & Wtf8 {
519+ const unsafe fn from_bytes_unchecked ( value : & [ u8 ] ) -> & Wtf8 {
520520 mem:: transmute ( value)
521521 }
522522
You can’t perform that action at this time.
0 commit comments