Skip to content

Commit cf7b053

Browse files
committed
Fix clippy::uninlined_format_args and format imports
1 parent 2b0518f commit cf7b053

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

src/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
//!
33
//! See the description of the individual error types for more details.
44
5-
use std::{io, path::PathBuf};
5+
use std::io;
6+
use std::path::PathBuf;
67

78
/// Error type for misc_utils crate.
89
///

src/fs.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@ use log::{info, warn};
7878
use serde::de::DeserializeOwned;
7979
#[cfg(feature = "jsonl")]
8080
use serde_json::Deserializer;
81-
use std::{
82-
ffi::OsStr,
83-
fs::OpenOptions,
84-
io::{BufReader, BufWriter, Read, Seek, SeekFrom, Write},
85-
path::{Path, PathBuf},
86-
};
81+
use std::ffi::OsStr;
82+
use std::fs::OpenOptions;
83+
use std::io::{BufReader, BufWriter, Read, Seek, SeekFrom, Write};
84+
use std::path::{Path, PathBuf};
8785
#[cfg(feature = "jsonl")]
8886
use std::{io::BufRead, sync::mpsc, thread};
8987
#[cfg(feature = "file-xz")]
@@ -764,7 +762,8 @@ where
764762
}
765763
} else {
766764
warn!(
767-
"Background parsing thread: did not receive complete message from underlying reader {:?}",
765+
"Background parsing thread: did not receive complete message from underlying \
766+
reader {:?}",
768767
thread::current().id()
769768
);
770769
}

src/minmax.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use num_traits::Bounded;
2-
use std::{
3-
fmt::{Display, Formatter, Result as FmtResult},
4-
str::FromStr,
5-
};
2+
use std::fmt::{Display, Formatter, Result as FmtResult};
3+
use std::str::FromStr;
64

75
/// Helper type to ensure to calculate a minimal value
86
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
@@ -92,7 +90,7 @@ where
9290
{
9391
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
9492
if let Some(v) = &self.value {
95-
write!(f, "{}", v)
93+
write!(f, "{v}")
9694
} else {
9795
write!(f, "<uninitialized>")
9896
}
@@ -198,7 +196,7 @@ where
198196
{
199197
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
200198
if let Some(v) = &self.value {
201-
write!(f, "{}", v)
199+
write!(f, "{v}")
202200
} else {
203201
write!(f, "<uninitialized>")
204202
}

src/path.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
//! This module contains functions for file system path manipulation.
22
3-
use std::{
4-
ffi::{OsStr, OsString},
5-
path::{Path, PathBuf},
6-
};
3+
use std::ffi::{OsStr, OsString};
4+
use std::path::{Path, PathBuf};
75

86
/// This traits extends the available methods on [`Path`].
97
pub trait PathExt {

tests/read-write.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ use misc_utils::byteascii::ByteAscii;
44
use misc_utils::fs::Compression;
55
use misc_utils::fs::{self, file_open_read, file_write};
66
use pretty_assertions::assert_eq;
7-
use std::{fs::File, io::prelude::*, path::Path};
7+
use std::fs::File;
8+
use std::io::prelude::*;
9+
use std::path::Path;
810
use tempfile::Builder;
911

1012
const LOREM_IPSUM: &str = r#"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod

0 commit comments

Comments
 (0)