1 use std::fmt;
2 use std::fmt::Formatter;
3
4 use super::Result;
5
6 #[inline(always)]
is_continuation(_: u8) -> bool7 pub(crate) const fn is_continuation(_: u8) -> bool {
8 false
9 }
10
11 #[inline(always)]
validate_bytes(_: &[u8]) -> Result<()>12 pub(crate) fn validate_bytes(_: &[u8]) -> Result<()> {
13 Ok(())
14 }
15
16 #[inline(always)]
decode_code_point(_: &[u8]) -> u3217 pub(crate) fn decode_code_point(_: &[u8]) -> u32 {
18 unreachable!();
19 }
20
ends_with(string: &[u8], suffix: &[u8]) -> bool21 pub(crate) fn ends_with(string: &[u8], suffix: &[u8]) -> bool {
22 string.ends_with(suffix)
23 }
24
starts_with(string: &[u8], prefix: &[u8]) -> bool25 pub(crate) fn starts_with(string: &[u8], prefix: &[u8]) -> bool {
26 string.starts_with(prefix)
27 }
28
debug(string: &[u8], f: &mut Formatter<'_>) -> fmt::Result29 pub(crate) fn debug(string: &[u8], f: &mut Formatter<'_>) -> fmt::Result {
30 for byte in string {
31 write!(f, "\\x{:02X}", byte)?;
32 }
33 Ok(())
34 }
35
36 #[cfg(feature = "uniquote")]
37 pub(crate) mod uniquote {
38 use uniquote::Formatter;
39 use uniquote::Quote;
40 use uniquote::Result;
41
escape(string: &[u8], f: &mut Formatter<'_>) -> Result42 pub(crate) fn escape(string: &[u8], f: &mut Formatter<'_>) -> Result {
43 string.escape(f)
44 }
45 }
46