Skip to content

Commit 09c205b

Browse files
committed
fixup! fix: unsoundness in NgxStr conversions
1 parent 8c756e1 commit 09c205b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ mod tests {
244244
let a: &NgxStr = "Hello World!".into();
245245

246246
let s = "Hello World!".to_string();
247-
let b: &NgxStr = NgxStr::from_bytes(s.as_bytes());
247+
let b: &NgxStr = s.as_bytes().into();
248248

249249
// The compiler should detect that s is borrowed and fail.
250250
// drop(s); // ☢️

0 commit comments

Comments
 (0)