File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 11use core:: slice;
22use core:: str:: { self , Utf8Error } ;
33
4- #[ cfg( all( not( feature = "std" ) , feature = "alloc" ) ) ]
5- use alloc:: { borrow:: Cow , string:: String } ;
6- #[ cfg( feature = "std" ) ]
7- use std:: { borrow:: Cow , string:: String } ;
8-
94use crate :: ffi:: * ;
105
116/// Static string initializer for [`ngx_str_t`].
@@ -68,9 +63,11 @@ impl NgxStr {
6863 /// Converts an [`NgxStr`] into a [`Cow<str>`], replacing invalid UTF-8 sequences.
6964 ///
7065 /// See [`String::from_utf8_lossy`].
71- #[ cfg( feature = "alloc" ) ]
72- pub fn to_string_lossy ( & self ) -> Cow < str > {
73- String :: from_utf8_lossy ( self . as_bytes ( ) )
66+ ///
67+ /// This module is temporally available only with `std` feature.
68+ #[ cfg( feature = "std" ) ]
69+ pub fn to_string_lossy ( & self ) -> std:: borrow:: Cow < str > {
70+ std:: string:: String :: from_utf8_lossy ( self . as_bytes ( ) )
7471 }
7572
7673 /// Returns `true` if the [`NgxStr`] is empty, otherwise `false`.
You can’t perform that action at this time.
0 commit comments