File tree Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1509,7 +1509,7 @@ impl<'a> IoSlice<'a> {
1509
1509
///
1510
1510
/// assert_eq!(io_slice.as_bytes(), b"def");
1511
1511
/// ```
1512
- #[ unstable( feature = "io_slice_as_bytes" ) ]
1512
+ #[ unstable( feature = "io_slice_as_bytes" , issue = "111277" ) ]
1513
1513
#[ inline]
1514
1514
#[ must_use]
1515
1515
pub const fn as_bytes ( & self ) -> & ' a [ u8 ] {
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ impl<'a> IoSlice<'a> {
33
33
}
34
34
35
35
#[ inline]
36
- pub fn as_slice ( & self ) -> & ' a [ u8 ] {
36
+ pub const fn as_slice ( & self ) -> & ' a [ u8 ] {
37
37
unsafe { slice:: from_raw_parts ( self . vec . iov_base as * mut u8 , self . vec . iov_len ) }
38
38
}
39
39
}
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ impl<'a> IoSlice<'a> {
33
33
}
34
34
35
35
#[ inline]
36
- pub fn as_slice ( & self ) -> & ' a [ u8 ] {
36
+ pub const fn as_slice ( & self ) -> & ' a [ u8 ] {
37
37
unsafe { slice:: from_raw_parts ( self . vec . iov_base as * mut u8 , self . vec . iov_len ) }
38
38
}
39
39
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ impl<'a> IoSlice<'a> {
15
15
}
16
16
17
17
#[ inline]
18
- pub fn as_slice ( & self ) -> & ' a [ u8 ] {
18
+ pub const fn as_slice ( & self ) -> & ' a [ u8 ] {
19
19
self . 0
20
20
}
21
21
}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ impl<'a> IoSlice<'a> {
30
30
}
31
31
32
32
#[ inline]
33
- pub fn as_slice ( & self ) -> & ' a [ u8 ] {
33
+ pub const fn as_slice ( & self ) -> & ' a [ u8 ] {
34
34
unsafe { slice:: from_raw_parts ( self . vec . buf as * const u8 , self . vec . buf_len ) }
35
35
}
36
36
}
You can’t perform that action at this time.
0 commit comments