diff options
Diffstat (limited to 'src/util/small_cstr.rs')
-rw-r--r-- | src/util/small_cstr.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/small_cstr.rs b/src/util/small_cstr.rs index 7349df0..4543c62 100644 --- a/src/util/small_cstr.rs +++ b/src/util/small_cstr.rs @@ -1,7 +1,7 @@ use smallvec::{smallvec, SmallVec}; use std::ffi::{CStr, CString, NulError}; -/// Similar to std::ffi::CString, but avoids heap allocating if the string is +/// Similar to `std::ffi::CString`, but avoids heap allocating if the string is /// small enough. Also guarantees it's input is UTF-8 -- used for cases where we /// need to pass a NUL-terminated string to SQLite, and we have a `&str`. #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] @@ -10,7 +10,7 @@ pub(crate) struct SmallCString(smallvec::SmallVec<[u8; 16]>); impl SmallCString { #[inline] pub fn new(s: &str) -> Result<Self, NulError> { - if s.as_bytes().contains(&0u8) { + if s.as_bytes().contains(&0_u8) { return Err(Self::fabricate_nul_error(s)); } let mut buf = SmallVec::with_capacity(s.len() + 1); @@ -31,7 +31,7 @@ impl SmallCString { /// Get the bytes not including the NUL terminator. E.g. the bytes which /// make up our `str`: /// - `SmallCString::new("foo").as_bytes_without_nul() == b"foo"` - /// - `SmallCString::new("foo").as_bytes_with_nul() == b"foo\0" + /// - `SmallCString::new("foo").as_bytes_with_nul() == b"foo\0"` #[inline] pub fn as_bytes_without_nul(&self) -> &[u8] { self.debug_checks(); |