Lines Matching full:let
63 /// let ascii = b_str!("Hello, BStr!");
64 /// let s = CString::try_from_fmt(fmt!("{ascii}"))?;
67 /// let non_ascii = b_str!("?");
68 /// let s = CString::try_from_fmt(fmt!("{non_ascii}"))?;
95 /// let ascii = b_str!("Hello, \"BStr\"!");
96 /// let s = CString::try_from_fmt(fmt!("{ascii:?}"))?;
99 /// let non_ascii = b_str!("?");
100 /// let s = CString::try_from_fmt(fmt!("{non_ascii:?}"))?;
252 let len = unsafe { bindings::strlen(ptr) } + 1;
254 let bytes = unsafe { core::slice::from_raw_parts(ptr.cast(), len) };
271 let mut i = 0;
360 /// let cstr = CStr::from_bytes_with_nul(b"foo\0")?;
381 /// let bar = c_str!("ツ");
438 let mut s = self.to_cstring()?;
455 let mut s = self.to_cstring()?;
471 /// let penguin = c_str!("?");
472 /// let s = CString::try_from_fmt(fmt!("{penguin}"))?;
475 /// let ascii = c_str!("so \"cool\"");
476 /// let s = CString::try_from_fmt(fmt!("{ascii}"))?;
501 /// let penguin = c_str!("?");
502 /// let s = CString::try_from_fmt(fmt!("{penguin:?}"))?;
506 /// let ascii = c_str!("so \"cool\"");
507 /// let s = CString::try_from_fmt(fmt!("{ascii:?}"))?;
548 let _ = &self.as_bytes()[index.start..];
637 let good_bytes = b"\xf0\x9f\xa6\x80\0";
638 let checked_cstr = CStr::from_bytes_with_nul(good_bytes)?;
639 let checked_str = checked_cstr.to_str()?;
646 let bad_bytes = b"\xc3\x28\0";
647 let checked_cstr = CStr::from_bytes_with_nul(bad_bytes)?;
654 let good_bytes = b"\xf0\x9f\x90\xA7\0";
655 let checked_cstr = CStr::from_bytes_with_nul(good_bytes)?;
657 let unchecked_str = unsafe { checked_cstr.as_str_unchecked() };
664 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0")?;
666 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0")?;
668 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0")?;
670 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0")?;
677 let mut bytes: [u8; 256] = [0; 256];
682 let cstr = CStr::from_bytes_with_nul(&bytes)?;
689 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0")?;
691 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0")?;
693 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0")?;
695 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0")?;
702 let hello_world = BStr::from_bytes(b"hello, world!");
704 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_");
706 let others = BStr::from_bytes(b"\x01");
708 let non_ascii = BStr::from_bytes(b"d\xe9j\xe0 vu");
710 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80");
717 let hello_world = BStr::from_bytes(b"hello, world!");
719 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_");
721 let others = BStr::from_bytes(b"\x01");
723 let non_ascii = BStr::from_bytes(b"d\xe9j\xe0 vu");
725 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80");
780 let pos = buf as usize;
807 let pos_new = self.pos.saturating_add(s.len());
810 let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);
901 let bytes = s.as_bytes();
902 let len = bytes.len();
910 let buffer = core::mem::take(&mut self.buffer);
927 let mut result: bool = false;
995 let stack_string = [*bytes.first().unwrap_or(&0), *bytes.get(1).unwrap_or(&0), 0];
1014 /// let s = CString::try_from_fmt(fmt!("{}{}{}", "abc", 10, 20))?;
1017 /// let tmp = "testing";
1018 /// let s = CString::try_from_fmt(fmt!("{tmp}{}", 123))?;
1022 /// let s = CString::try_from_fmt(fmt!("a\0b{}", 123));
1034 let mut f = RawFormatter::new();
1037 let size = f.bytes_written();
1040 let mut buf = KVec::with_capacity(size, GFP_KERNEL)?;
1042 let mut f = unsafe { Formatter::from_buffer(buf.as_mut_ptr(), size) };
1054 let ptr = unsafe { bindings::memchr(buf.as_ptr().cast(), 0, f.bytes_written() - 1) };
1087 let mut buf = KVec::new();