Lines Matching full:let
58 /// let ascii = b_str!("Hello, BStr!");
59 /// let s = CString::try_from_fmt(fmt!("{}", ascii))?;
62 /// let non_ascii = b_str!("");
63 /// let s = CString::try_from_fmt(fmt!("{}", non_ascii))?;
90 /// let ascii = b_str!("Hello, \"BStr\"!");
91 /// let s = CString::try_from_fmt(fmt!("{:?}", ascii))?;
94 /// let non_ascii = b_str!("");
95 /// let s = CString::try_from_fmt(fmt!("{:?}", non_ascii))?;
238 let len = unsafe { bindings::strlen(ptr) } + 1; in from_char_ptr()
240 let bytes = unsafe { core::slice::from_raw_parts(ptr as _, len) }; in from_char_ptr()
257 let mut i = 0; in from_bytes_with_nul()
324 /// let cstr = CStr::from_bytes_with_nul(b"foo\0")?;
345 /// let bar = c_str!("ツ");
402 let mut s = self.to_cstring()?; in to_ascii_lowercase()
419 let mut s = self.to_cstring()?; in to_ascii_uppercase()
435 /// let penguin = c_str!("");
436 /// let s = CString::try_from_fmt(fmt!("{}", penguin))?;
439 /// let ascii = c_str!("so \"cool\"");
440 /// let s = CString::try_from_fmt(fmt!("{}", ascii))?;
465 /// let penguin = c_str!("");
466 /// let s = CString::try_from_fmt(fmt!("{:?}", penguin))?;
470 /// let ascii = c_str!("so \"cool\"");
471 /// let s = CString::try_from_fmt(fmt!("{:?}", ascii))?;
512 let _ = &self.as_bytes()[index.start..]; in index()
618 let good_bytes = b"\xf0\x9f\xa6\x80\0"; in test_cstr_to_str()
619 let checked_cstr = CStr::from_bytes_with_nul(good_bytes).unwrap(); in test_cstr_to_str()
620 let checked_str = checked_cstr.to_str().unwrap(); in test_cstr_to_str()
627 let bad_bytes = b"\xc3\x28\0"; in test_cstr_to_str_panic()
628 let checked_cstr = CStr::from_bytes_with_nul(bad_bytes).unwrap(); in test_cstr_to_str_panic()
634 let good_bytes = b"\xf0\x9f\x90\xA7\0"; in test_cstr_as_str_unchecked()
635 let checked_cstr = CStr::from_bytes_with_nul(good_bytes).unwrap(); in test_cstr_as_str_unchecked()
637 let unchecked_str = unsafe { checked_cstr.as_str_unchecked() }; in test_cstr_as_str_unchecked()
643 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0").unwrap(); in test_cstr_display()
645 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0").unwrap(); in test_cstr_display()
647 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0").unwrap(); in test_cstr_display()
649 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0").unwrap(); in test_cstr_display()
655 let mut bytes: [u8; 256] = [0; 256]; in test_cstr_display_all_bytes()
660 let cstr = CStr::from_bytes_with_nul(&bytes).unwrap(); in test_cstr_display_all_bytes()
666 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0").unwrap(); in test_cstr_debug()
668 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0").unwrap(); in test_cstr_debug()
670 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0").unwrap(); in test_cstr_debug()
672 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0").unwrap(); in test_cstr_debug()
678 let hello_world = BStr::from_bytes(b"hello, world!"); in test_bstr_display()
680 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_"); in test_bstr_display()
682 let others = BStr::from_bytes(b"\x01"); in test_bstr_display()
684 let non_ascii = BStr::from_bytes(b"d\xe9j\xe0 vu"); in test_bstr_display()
686 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80"); in test_bstr_display()
692 let hello_world = BStr::from_bytes(b"hello, world!"); in test_bstr_debug()
694 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_"); in test_bstr_debug()
696 let others = BStr::from_bytes(b"\x01"); in test_bstr_debug()
698 let non_ascii = BStr::from_bytes(b"d\xe9j\xe0 vu"); in test_bstr_debug()
700 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80"); in test_bstr_debug()
754 let pos = buf as usize; in from_buffer()
781 let pos_new = self.pos.saturating_add(s.len()); in write_str()
784 let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos); in write_str()
855 /// let s = CString::try_from_fmt(fmt!("{}{}{}", "abc", 10, 20))?;
858 /// let tmp = "testing";
859 /// let s = CString::try_from_fmt(fmt!("{tmp}{}", 123))?;
863 /// let s = CString::try_from_fmt(fmt!("a\0b{}", 123));
875 let mut f = RawFormatter::new(); in try_from_fmt()
878 let size = f.bytes_written(); in try_from_fmt()
881 let mut buf = KVec::with_capacity(size, GFP_KERNEL)?; in try_from_fmt()
883 let mut f = unsafe { Formatter::from_buffer(buf.as_mut_ptr(), size) }; in try_from_fmt()
895 let ptr = unsafe { bindings::memchr(buf.as_ptr().cast(), 0, f.bytes_written() - 1) }; in try_from_fmt()
928 let mut buf = KVec::new(); in try_from()