Lines Matching +full:0 +full:x9f
19 self.0.len() in len()
25 self.len() == 0 in is_empty()
47 /// assert_eq!(s.as_bytes(), "\\xf0\\x9f\\xa6\\x80".as_bytes());
51 for &b in &self.0 { in fmt()
58 0x20..=0x7e => f.write_char(b as char)?, in fmt()
79 /// assert_eq!(s.as_bytes(), "\"\\xf0\\x9f\\x98\\xba\"".as_bytes());
84 for &b in &self.0 { in fmt()
94 0x20..=0x7e => f.write_char(b as char)?, in fmt()
107 &self.0 in deref()
166 if self.0.is_empty() { in len_with_nul()
172 self.0.len() in len_with_nul()
178 self.len() == 0 in is_empty()
208 if bytes[bytes.len() - 1] != 0 { in from_bytes_with_nul()
211 let mut i = 0; in from_bytes_with_nul()
215 if bytes[i] == 0 { in from_bytes_with_nul()
253 self.0.as_ptr() in as_char_ptr()
259 &self.0[..self.len()] in as_bytes()
265 &self.0 in as_bytes_with_nul()
278 /// let cstr = CStr::from_bytes_with_nul(b"foo\0")?;
328 self.0.make_ascii_lowercase(); in make_ascii_lowercase()
343 self.0.make_ascii_uppercase(); in make_ascii_uppercase()
391 /// assert_eq!(s.as_bytes_with_nul(), "\\xf0\\x9f\\x90\\xa7\0".as_bytes());
395 /// assert_eq!(s.as_bytes_with_nul(), "so \"cool\"\0".as_bytes());
400 if (0x20..0x7f).contains(&c) { in fmt()
421 /// assert_eq!(s.as_bytes_with_nul(), "\"\\xf0\\x9f\\x90\\xa7\"\0".as_bytes());
426 /// assert_eq!(s.as_bytes_with_nul(), "\"so \\\"cool\\\"\"\0".as_bytes());
435 0x20..=0x7e => f.write_char(c as char)?, in fmt()
468 unsafe { Self::from_bytes_with_nul_unchecked(&self.0[index.start..]) } in index()
520 const S: &str = concat!($str, "\0");
546 self.0.to_str().unwrap() in deref()
562 \\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b\\x9c\\x9d\\x9e\\x9f\
572 let good_bytes = b"\xf0\x9f\xa6\x80\0"; in test_cstr_to_str()
581 let bad_bytes = b"\xc3\x28\0"; in test_cstr_to_str_panic()
588 let good_bytes = b"\xf0\x9f\x90\xA7\0"; in test_cstr_as_str_unchecked()
597 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0").unwrap(); in test_cstr_display()
599 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0").unwrap(); in test_cstr_display()
601 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0").unwrap(); in test_cstr_display()
603 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0").unwrap(); in test_cstr_display()
604 assert_eq!(format!("{}", good_bytes), "\\xf0\\x9f\\xa6\\x80"); in test_cstr_display()
609 let mut bytes: [u8; 256] = [0; 256]; in test_cstr_display_all_bytes()
610 // fill `bytes` with [1..=255] + [0] in test_cstr_display_all_bytes()
620 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0").unwrap(); in test_cstr_debug()
622 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0").unwrap(); in test_cstr_debug()
624 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0").unwrap(); in test_cstr_debug()
626 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0").unwrap(); in test_cstr_debug()
627 assert_eq!(format!("{:?}", good_bytes), "\"\\xf0\\x9f\\xa6\\x80\""); in test_cstr_debug()
640 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80"); in test_bstr_display()
641 assert_eq!(format!("{}", good_bytes), "\\xf0\\x9f\\xa6\\x80"); in test_bstr_display()
654 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80"); in test_bstr_debug()
655 assert_eq!(format!("{:?}", good_bytes), "\"\\xf0\\x9f\\xa6\\x80\""); in test_bstr_debug()
680 beg: 0, in new()
681 pos: 0, in new()
682 end: 0, in new()
734 // don't want it to wrap around to 0. in write_str()
737 // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`. in write_str()
740 if len_to_copy > 0 { in write_str()
779 &self.0 in deref()
785 self.0.write_str(s)?; in write_str()
788 if self.0.pos > self.0.end { in write_str()
810 /// assert_eq!(s.as_bytes_with_nul(), "abc1020\0".as_bytes());
814 /// assert_eq!(s.as_bytes_with_nul(), "testing123\0".as_bytes());
817 /// let s = CString::try_from_fmt(fmt!("a\0b{}", 123));
831 f.write_str("\0")?; in try_from_fmt()
839 f.write_str("\0")?; in try_from_fmt()
849 let ptr = unsafe { bindings::memchr(buf.as_ptr().cast(), 0, f.bytes_written() - 1) }; in try_from_fmt()