Skip to content

Commit

Permalink
Apply clippy::unused_trait_names lint
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 13, 2025
1 parent 56b635c commit e097c83
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ inline_asm_x86_att_syntax = "warn"
trailing_empty_array = "warn"
transmute_undefined_repr = "warn"
undocumented_unsafe_blocks = "warn"
unused_trait_names = "warn"
# Suppress buggy or noisy clippy lints
bool_assert_comparison = { level = "allow", priority = 1 }
borrow_as_ptr = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/8286
Expand Down
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use anyhow::{bail, format_err, Error, Result};
use camino::{Utf8Path, Utf8PathBuf};
use lexopt::{
Arg::{Long, Short, Value},
ValueExt,
ValueExt as _,
};

use crate::{
Expand Down Expand Up @@ -1396,7 +1396,7 @@ fn unexpected(arg: &str, subcommand: Subcommand) -> Result<()> {
mod tests {
use std::{
env,
io::Write,
io::Write as _,
path::Path,
process::{Command, Stdio},
};
Expand Down
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::{
ffi::OsString,
io::{self, Write},
io::{self, Write as _},
path::PathBuf,
};

Expand Down
2 changes: 1 addition & 1 deletion src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{
use anyhow::{Context as _, Result};
use camino::Utf8PathBuf;
use regex::Regex;
use serde::ser::{Serialize, SerializeMap, Serializer};
use serde::ser::{Serialize, SerializeMap as _, Serializer};
use serde_derive::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use std::{
collections::{BTreeSet, HashMap},
ffi::{OsStr, OsString},
io::{self, BufRead, Read, Write},
io::{self, BufRead as _, Read as _, Write as _},
path::Path,
time::SystemTime,
};
Expand Down
12 changes: 6 additions & 6 deletions src/term.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use std::{
io::Write,
io::Write as _,
str::FromStr,
sync::atomic::{AtomicBool, AtomicU8, Ordering},
};

use anyhow::Error;
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor as _};

#[derive(Debug, Clone, Copy, PartialEq)]
#[repr(u8)]
Expand Down Expand Up @@ -122,7 +122,7 @@ pub(crate) fn print_status(status: &str, color: Option<Color>, justified: bool)

macro_rules! error {
($($msg:expr),* $(,)?) => {{
use std::io::Write;
use std::io::Write as _;
crate::term::error::set(true);
let mut stream = crate::term::print_status("error", Some(termcolor::Color::Red), false);
let _ = writeln!(stream, $($msg),*);
Expand All @@ -131,7 +131,7 @@ macro_rules! error {

macro_rules! warn {
($($msg:expr),* $(,)?) => {{
use std::io::Write;
use std::io::Write as _;
crate::term::warn::set(true);
let mut stream = crate::term::print_status("warning", Some(termcolor::Color::Yellow), false);
let _ = writeln!(stream, $($msg),*);
Expand All @@ -140,15 +140,15 @@ macro_rules! warn {

macro_rules! info {
($($msg:expr),* $(,)?) => {{
use std::io::Write;
use std::io::Write as _;
let mut stream = crate::term::print_status("info", None, false);
let _ = writeln!(stream, $($msg),*);
}};
}

macro_rules! status {
($status:expr, $($msg:expr),* $(,)?) => {{
use std::io::Write;
use std::io::Write as _;
let mut stream = crate::term::print_status($status, Some(termcolor::Color::Cyan), true);
let _ = writeln!(stream, $($msg),*);
}};
Expand Down
2 changes: 1 addition & 1 deletion tests/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::{
env,
ffi::OsStr,
io::{Read, Seek, Write},
io::{Read as _, Seek as _, Write as _},
mem,
path::{Path, PathBuf},
process::{Command, ExitStatus, Stdio},
Expand Down
2 changes: 1 addition & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use fs_err as fs;

use self::auxiliary::{
assert_output, cargo_llvm_cov, fixtures_path, normalize_output, perturb_one_header,
test_project, test_report, CommandExt,
test_project, test_report, CommandExt as _,
};

const SUBCOMMANDS: &[&str] = &["", "run", "report", "clean", "show-env", "nextest"];
Expand Down

0 comments on commit e097c83

Please sign in to comment.