Lines Matching refs:as_bytes
82 /// assert_eq!(s.to_bytes(), "Hello, BStr!".as_bytes());
86 /// assert_eq!(s.to_bytes(), "\\xf0\\x9f\\xa6\\x80".as_bytes());
114 /// assert_eq!(s.to_bytes(), "\"Hello, \\\"BStr\\\"!\"".as_bytes());
118 /// assert_eq!(s.to_bytes(), "\"\\xf0\\x9f\\x98\\xba\"".as_bytes());
195 const C: &'static $crate::str::BStr = $crate::str::BStr::from_bytes(S.as_bytes());
301 /// assert_eq!(s.to_bytes_with_nul(), "\\xf0\\x9f\\x90\\xa7\0".as_bytes());
305 /// assert_eq!(s.to_bytes_with_nul(), "so \"cool\"\0".as_bytes());
423 const C: &$crate::str::CStr = match $crate::str::CStr::from_bytes_with_nul(S.as_bytes()) {
631 s.as_bytes().as_ptr(),
715 let bytes = s.as_bytes();
829 /// assert_eq!(s.to_bytes_with_nul(), "abc1020\0".as_bytes());
833 /// assert_eq!(s.to_bytes_with_nul(), "testing123\0".as_bytes());