Skip to content

Commit

Permalink
Merge pull request Stebalien#173 from rbtcollins/clippy
Browse files Browse the repository at this point in the history
Fix clippy & markdown lints
  • Loading branch information
Stebalien authored Jul 29, 2022
2 parents b8a34ca + 0aaeb2f commit 4e4e323
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Usage
Minimum required Rust version: 1.48.0

Add this to your `Cargo.toml`:

```toml
[dependencies]
tempfile = "3"
Expand Down
1 change: 0 additions & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use fastrand;
use std::ffi::{OsStr, OsString};
use std::path::{Path, PathBuf};
use std::{io, iter::repeat_with};
Expand Down
6 changes: 3 additions & 3 deletions tests/namedtempfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions tests/tempdir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`");
Expand All @@ -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`");
};
Expand Down Expand Up @@ -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());
Expand All @@ -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`");
Expand Down

0 comments on commit 4e4e323

Please sign in to comment.