]> git.lizzy.rs Git - rust.git/blobdiff - src/shims/foreign_items/posix/linux.rs
avoid using unchecked casts or arithmetic
[rust.git] / src / shims / foreign_items / posix / linux.rs
index 8a1ce5594ae46050a0c22e2b9ba34e60144c9ba6..023fee4ca7b1eef68bc37bed701bb41680e52751 100644 (file)
@@ -114,7 +114,7 @@ fn getrandom<'tcx>(
     // neither of which have any effect on our current PRNG.
     let _flags = this.read_scalar(args[2])?.to_i32()?;
 
-    this.gen_random(ptr, len as usize)?;
+    this.gen_random(ptr, len)?;
     this.write_scalar(Scalar::from_uint(len, dest.layout.size), dest)?;
     Ok(())
 }