File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ impl Buf {
150
150
151
151
impl Slice {
152
152
#[ inline]
153
- pub fn from_str ( s : & str ) -> & Slice {
153
+ pub const fn from_str ( s : & str ) -> & Slice {
154
154
unsafe { mem:: transmute ( Wtf8 :: from_str ( s) ) }
155
155
}
156
156
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ impl Wtf8 {
507
507
///
508
508
/// Since WTF-8 is a superset of UTF-8, this always succeeds.
509
509
#[ inline]
510
- pub fn from_str ( value : & str ) -> & Wtf8 {
510
+ pub const fn from_str ( value : & str ) -> & Wtf8 {
511
511
unsafe { Wtf8 :: from_bytes_unchecked ( value. as_bytes ( ) ) }
512
512
}
513
513
@@ -516,7 +516,7 @@ impl Wtf8 {
516
516
/// Since the byte slice is not checked for valid WTF-8, this functions is
517
517
/// marked unsafe.
518
518
#[ inline]
519
- unsafe fn from_bytes_unchecked ( value : & [ u8 ] ) -> & Wtf8 {
519
+ const unsafe fn from_bytes_unchecked ( value : & [ u8 ] ) -> & Wtf8 {
520
520
mem:: transmute ( value)
521
521
}
522
522
You can’t perform that action at this time.
0 commit comments