Lines Matching full:let

41     /// let ascii = b_str!("Hello, BStr!");
42 /// let s = CString::try_from_fmt(fmt!("{}", ascii))?;
45 /// let non_ascii = b_str!("��");
46 /// let s = CString::try_from_fmt(fmt!("{}", non_ascii))?;
73 /// let ascii = b_str!("Hello, \"BStr\"!");
74 /// let s = CString::try_from_fmt(fmt!("{:?}", ascii))?;
77 /// let non_ascii = b_str!("��");
78 /// let s = CString::try_from_fmt(fmt!("{:?}", non_ascii))?;
192 let len = unsafe { bindings::strlen(ptr) } + 1; in from_char_ptr()
194 let bytes = unsafe { core::slice::from_raw_parts(ptr as _, len) }; in from_char_ptr()
211 let mut i = 0; in from_bytes_with_nul()
278 /// let cstr = CStr::from_bytes_with_nul(b"foo\0")?;
299 /// let bar = c_str!("ツ");
356 let mut s = self.to_cstring()?; in to_ascii_lowercase()
373 let mut s = self.to_cstring()?; in to_ascii_uppercase()
389 /// let penguin = c_str!("��");
390 /// let s = CString::try_from_fmt(fmt!("{}", penguin))?;
393 /// let ascii = c_str!("so \"cool\"");
394 /// let s = CString::try_from_fmt(fmt!("{}", ascii))?;
419 /// let penguin = c_str!("��");
420 /// let s = CString::try_from_fmt(fmt!("{:?}", penguin))?;
424 /// let ascii = c_str!("so \"cool\"");
425 /// let s = CString::try_from_fmt(fmt!("{:?}", ascii))?;
466 let _ = &self.as_bytes()[index.start..]; in index()
572 let good_bytes = b"\xf0\x9f\xa6\x80\0"; in test_cstr_to_str()
573 let checked_cstr = CStr::from_bytes_with_nul(good_bytes).unwrap(); in test_cstr_to_str()
574 let checked_str = checked_cstr.to_str().unwrap(); in test_cstr_to_str()
581 let bad_bytes = b"\xc3\x28\0"; in test_cstr_to_str_panic()
582 let checked_cstr = CStr::from_bytes_with_nul(bad_bytes).unwrap(); in test_cstr_to_str_panic()
588 let good_bytes = b"\xf0\x9f\x90\xA7\0"; in test_cstr_as_str_unchecked()
589 let checked_cstr = CStr::from_bytes_with_nul(good_bytes).unwrap(); in test_cstr_as_str_unchecked()
591 let unchecked_str = unsafe { checked_cstr.as_str_unchecked() }; 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()
609 let mut bytes: [u8; 256] = [0; 256]; in test_cstr_display_all_bytes()
614 let cstr = CStr::from_bytes_with_nul(&bytes).unwrap(); 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()
632 let hello_world = BStr::from_bytes(b"hello, world!"); in test_bstr_display()
634 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_"); in test_bstr_display()
636 let others = BStr::from_bytes(b"\x01"); in test_bstr_display()
638 let non_ascii = BStr::from_bytes(b"d\xe9j\xe0 vu"); in test_bstr_display()
640 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80"); in test_bstr_display()
646 let hello_world = BStr::from_bytes(b"hello, world!"); in test_bstr_debug()
648 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_"); in test_bstr_debug()
650 let others = BStr::from_bytes(b"\x01"); in test_bstr_debug()
652 let non_ascii = BStr::from_bytes(b"d\xe9j\xe0 vu"); in test_bstr_debug()
654 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80"); in test_bstr_debug()
708 let pos = buf as usize; in from_buffer()
735 let pos_new = self.pos.saturating_add(s.len()); in write_str()
738 let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos); in write_str()
809 /// let s = CString::try_from_fmt(fmt!("{}{}{}", "abc", 10, 20))?;
812 /// let tmp = "testing";
813 /// let s = CString::try_from_fmt(fmt!("{tmp}{}", 123))?;
817 /// let s = CString::try_from_fmt(fmt!("a\0b{}", 123));
829 let mut f = RawFormatter::new(); in try_from_fmt()
832 let size = f.bytes_written(); in try_from_fmt()
835 let mut buf = KVec::with_capacity(size, GFP_KERNEL)?; in try_from_fmt()
837 let mut f = unsafe { Formatter::from_buffer(buf.as_mut_ptr(), size) }; in try_from_fmt()
849 let ptr = unsafe { bindings::memchr(buf.as_ptr().cast(), 0, f.bytes_written() - 1) }; in try_from_fmt()
882 let mut buf = KVec::new(); in try_from()