Skip to content

Commit

Permalink
Use str::from_utf8 instead
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz committed Sep 12, 2019
1 parent ed70617 commit fa20338
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/shims/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

pub mod foreign_items;
pub mod intrinsics;
pub mod tls;
Expand Down
2 changes: 1 addition & 1 deletion tests/run-pass/aligned_utf8_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
let mut y: Vec<u8> = unsafe { std::mem::transmute(x) };
unsafe { y.set_len(2 * N) };

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

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

0 comments on commit fa20338

Please sign in to comment.