Skip to content

Commit fa20338

Browse files
committed
Use str::from_utf8 instead
1 parent ed70617 commit fa20338

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/shims/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
pub mod foreign_items;
32
pub mod intrinsics;
43
pub mod tls;

tests/run-pass/aligned_utf8_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
let mut y: Vec<u8> = unsafe { std::mem::transmute(x) };
77
unsafe { y.set_len(2 * N) };
88

9-
println!("{:?}", String::from_utf8_lossy(&y));
9+
println!("{:?}", std::str::from_utf8(&y).unwrap());
1010

1111
let mut x: Vec<u16> = unsafe { std::mem::transmute(y) };
1212
unsafe { x.set_len(N) };

0 commit comments

Comments
 (0)