diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-10-23 23:09:44 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-11-10 01:10:07 +0100 |
| commit | e15c62d61fa02fac93992db9297aa4a8a56cef93 (patch) | |
| tree | 7f1e21f22c66f3d4988fdbf347031bd6d67a3af0 /src/libcore/str | |
| parent | d1d2aa22c0d15465af1daccdb3821450c98d0ed0 (diff) | |
| download | rust-e15c62d61fa02fac93992db9297aa4a8a56cef93.tar.gz rust-e15c62d61fa02fac93992db9297aa4a8a56cef93.zip | |
revert making internal APIs const fn.
Diffstat (limited to 'src/libcore/str')
| -rw-r--r-- | src/libcore/str/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index f5bfe804899..e710cbffe4d 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -476,16 +476,16 @@ pub struct Chars<'a> { /// The first byte is special, only want bottom 5 bits for width 2, 4 bits /// for width 3, and 3 bits for width 4. #[inline] -const fn utf8_first_byte(byte: u8, width: u32) -> u32 { (byte & (0x7F >> width)) as u32 } +fn utf8_first_byte(byte: u8, width: u32) -> u32 { (byte & (0x7F >> width)) as u32 } /// Returns the value of `ch` updated with continuation byte `byte`. #[inline] -const fn utf8_acc_cont_byte(ch: u32, byte: u8) -> u32 { (ch << 6) | (byte & CONT_MASK) as u32 } +fn utf8_acc_cont_byte(ch: u32, byte: u8) -> u32 { (ch << 6) | (byte & CONT_MASK) as u32 } /// Checks whether the byte is a UTF-8 continuation byte (i.e. starts with the /// bits `10`). #[inline] -const fn utf8_is_cont_byte(byte: u8) -> bool { (byte & !CONT_MASK) == TAG_CONT_U8 } +fn utf8_is_cont_byte(byte: u8) -> bool { (byte & !CONT_MASK) == TAG_CONT_U8 } #[inline] fn unwrap_or_0(opt: Option<&u8>) -> u8 { @@ -1420,7 +1420,7 @@ const NONASCII_MASK: usize = 0x80808080_80808080u64 as usize; /// Returns `true` if any byte in the word `x` is nonascii (>= 128). #[inline] -const fn contains_nonascii(x: usize) -> bool { +fn contains_nonascii(x: usize) -> bool { (x & NONASCII_MASK) != 0 } |
