File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ impl AsciiStr {
39
39
40
40
/// Returns the entire string as slice of `AsciiChar`s.
41
41
#[ inline]
42
- pub fn as_slice ( & self ) -> & [ AsciiChar ] {
42
+ pub const fn as_slice ( & self ) -> & [ AsciiChar ] {
43
43
& self . slice
44
44
}
45
45
@@ -55,7 +55,7 @@ impl AsciiStr {
55
55
/// will end up pointing to garbage. Modifying the `AsciiStr` may cause it's buffer to be
56
56
/// reallocated, which would also make any pointers to it invalid.
57
57
#[ inline]
58
- pub fn as_ptr ( & self ) -> * const AsciiChar {
58
+ pub const fn as_ptr ( & self ) -> * const AsciiChar {
59
59
self . as_slice ( ) . as_ptr ( )
60
60
}
61
61
@@ -683,13 +683,13 @@ impl AsAsciiStrError {
683
683
///
684
684
/// It is the maximum index such that `from_ascii(input[..index])` would return `Ok(_)`.
685
685
#[ inline]
686
- pub fn valid_up_to ( self ) -> usize {
686
+ pub const fn valid_up_to ( self ) -> usize {
687
687
self . 0
688
688
}
689
689
#[ cfg( not( feature = "std" ) ) ]
690
690
/// Returns a description for this error, like `std::error::Error::description`.
691
691
#[ inline]
692
- pub fn description ( & self ) -> & ' static str {
692
+ pub const fn description ( & self ) -> & ' static str {
693
693
ERRORMSG_STR
694
694
}
695
695
}
You can’t perform that action at this time.
0 commit comments