diff --git a/README.md b/README.md index e9bd7a7b7..bf207f8a4 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Usage Minimum required Rust version: 1.48.0 Add this to your `Cargo.toml`: + ```toml [dependencies] tempfile = "3" diff --git a/src/util.rs b/src/util.rs index 5e95e5fcc..98c3ee804 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,4 +1,3 @@ -use fastrand; use std::ffi::{OsStr, OsString}; use std::path::{Path, PathBuf}; use std::{io, iter::repeat_with}; diff --git a/tests/namedtempfile.rs b/tests/namedtempfile.rs index cfdee337a..22ec6a4f0 100644 --- a/tests/namedtempfile.rs +++ b/tests/namedtempfile.rs @@ -87,7 +87,7 @@ fn test_persist_noclobber() { fn test_customnamed() { let tmpfile = Builder::new() .prefix("tmp") - .suffix(&".rs".to_string()) + .suffix(&".rs") .rand_bytes(12) .tempfile() .unwrap(); @@ -100,9 +100,9 @@ fn test_customnamed() { #[test] fn test_append() { let mut tmpfile = Builder::new().append(true).tempfile().unwrap(); - tmpfile.write(b"a").unwrap(); + tmpfile.write_all(b"a").unwrap(); tmpfile.seek(SeekFrom::Start(0)).unwrap(); - tmpfile.write(b"b").unwrap(); + tmpfile.write_all(b"b").unwrap(); tmpfile.seek(SeekFrom::Start(0)).unwrap(); let mut buf = vec![0u8; 1]; diff --git a/tests/tempdir.rs b/tests/tempdir.rs index 746fe4738..de9723328 100644 --- a/tests/tempdir.rs +++ b/tests/tempdir.rs @@ -67,7 +67,7 @@ fn test_customnamed() { fn test_rm_tempdir() { let (tx, rx) = channel(); - let f = move || -> () { + let f = move || { let tmp = t!(TempDir::new()); tx.send(tmp.path().to_path_buf()).unwrap(); panic!("panic to unwind past `tmp`"); @@ -78,7 +78,7 @@ fn test_rm_tempdir() { let tmp = t!(TempDir::new()); let path = tmp.path().to_path_buf(); - let f = move || -> () { + let f = move || { let _tmp = tmp; panic!("panic to unwind past `tmp`"); }; @@ -107,7 +107,7 @@ fn test_rm_tempdir() { fn test_rm_tempdir_close() { let (tx, rx) = channel(); - let f = move || -> () { + let f = move || { let tmp = t!(TempDir::new()); tx.send(tmp.path().to_path_buf()).unwrap(); t!(tmp.close()); @@ -119,7 +119,7 @@ fn test_rm_tempdir_close() { let tmp = t!(TempDir::new()); let path = tmp.path().to_path_buf(); - let f = move || -> () { + let f = move || { let tmp = tmp; t!(tmp.close()); panic!("panic when unwinding past `tmp`");