We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1ffd81 commit b09e48eCopy full SHA for b09e48e
src/core/string.rs
@@ -1,4 +1,3 @@
1
-use core::slice;
2
use core::str::{self, Utf8Error};
3
4
#[cfg(all(not(feature = "std"), feature = "alloc"))]
@@ -39,7 +38,7 @@ impl NgxStr {
39
38
/// to range of bytes of at least `len` bytes, whose content remains valid and doesn't
40
/// change for the lifetime of the returned `NgxStr`.
41
pub unsafe fn from_ngx_str<'a>(str: ngx_str_t) -> &'a NgxStr {
42
- slice::from_raw_parts(str.data, str.len).into()
+ str.as_bytes().into()
43
}
44
45
/// Access the [`NgxStr`] as a byte slice.
0 commit comments