Skip to content

Commit

Permalink
[clippy] fixes for Rust 1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshowers committed Nov 29, 2024
1 parent 0a05d67 commit 2c4b51a
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions cargo-nextest/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ struct MessageVisitor<'writer, 'a> {
error: Option<fmt::Error>,
}

impl<'writer, 'a> Visit for MessageVisitor<'writer, 'a> {
impl Visit for MessageVisitor<'_, '_> {
fn record_debug(&mut self, field: &Field, value: &dyn fmt::Debug) {
if field.name() == MESSAGE_FIELD {
if let Err(error) = write!(self.writer, "{:?}", value) {
Expand Down Expand Up @@ -385,7 +385,7 @@ pub(crate) enum StdoutWriter<'a> {
Test { buf: &'a mut Vec<u8> },
}

impl<'a> Write for StdoutWriter<'a> {
impl Write for StdoutWriter<'_> {
fn write(&mut self, data: &[u8]) -> std::io::Result<usize> {
match self {
Self::Normal { buf, .. } => buf.write(data),
Expand All @@ -403,7 +403,7 @@ impl<'a> Write for StdoutWriter<'a> {
}
}

impl<'a> WriteStr for StdoutWriter<'a> {
impl WriteStr for StdoutWriter<'_> {
fn write_str(&mut self, s: &str) -> io::Result<()> {
match self {
Self::Normal { buf, .. } => buf.write_all(s.as_bytes()),
Expand All @@ -430,7 +430,7 @@ pub(crate) enum StderrWriter<'a> {
Test { buf: &'a mut Vec<u8> },
}

impl<'a> Write for StderrWriter<'a> {
impl Write for StderrWriter<'_> {
fn write(&mut self, data: &[u8]) -> std::io::Result<usize> {
match self {
Self::Normal { buf, .. } => buf.write(data),
Expand Down
2 changes: 1 addition & 1 deletion nextest-filtering/tests/match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct BinaryQueryCreator<'a> {
platform: BuildPlatform,
}

impl<'a> BinaryQueryCreator<'a> {
impl BinaryQueryCreator<'_> {
fn to_query(&self) -> BinaryQuery<'_> {
BinaryQuery {
package_id: self.package_id,
Expand Down
4 changes: 2 additions & 2 deletions nextest-runner/src/config/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl<'de> Deserialize<'de> for ArchiveIncludeOnMissing {
{
struct ArchiveIncludeOnMissingVisitor;

impl<'de> serde::de::Visitor<'de> for ArchiveIncludeOnMissingVisitor {
impl serde::de::Visitor<'_> for ArchiveIncludeOnMissingVisitor {
type Value = ArchiveIncludeOnMissing;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -174,7 +174,7 @@ impl<'de> Deserialize<'de> for RecursionDepth {
{
struct RecursionDepthVisitor;

impl<'de> serde::de::Visitor<'de> for RecursionDepthVisitor {
impl serde::de::Visitor<'_> for RecursionDepthVisitor {
type Value = RecursionDepth;

fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/config/scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub(crate) struct SetupScript<'profile> {
pub(crate) compiled: Vec<&'profile CompiledProfileScripts<FinalConfig>>,
}

impl<'profile> SetupScript<'profile> {
impl SetupScript<'_> {
pub(crate) fn is_enabled(&self, test: &TestQuery<'_>, cx: &EvalContext<'_>) -> bool {
self.compiled
.iter()
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/config/test_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub(super) struct BinaryQueryCreator<'a> {
platform: BuildPlatform,
}

impl<'a> BinaryQueryCreator<'a> {
impl BinaryQueryCreator<'_> {
pub(super) fn to_query(&self) -> BinaryQuery<'_> {
BinaryQuery {
package_id: self.package_id,
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/config/test_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'de> Deserialize<'de> for TestThreads {
{
struct V;

impl<'de2> serde::de::Visitor<'de2> for V {
impl serde::de::Visitor<'_> for V {
type Value = TestThreads;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/config/threads_required.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<'de> Deserialize<'de> for ThreadsRequired {
{
struct V;

impl<'de2> serde::de::Visitor<'de2> for V {
impl serde::de::Visitor<'_> for V {
type Value = ThreadsRequired;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ pub(crate) fn display_nt_status(nt_status: windows_sys::Win32::Foundation::NTSTA
#[derive(Copy, Clone, Debug)]
pub(crate) struct QuotedDisplay<'a, T: ?Sized>(pub(crate) &'a T);

impl<'a, T: ?Sized> fmt::Display for QuotedDisplay<'a, T>
impl<T: ?Sized> fmt::Display for QuotedDisplay<'_, T>
where
T: fmt::Display,
{
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/list/display_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) enum DisplayFilterMatcher<'list, 'filter> {
Some(&'filter HashSet<&'list str>),
}

impl<'list, 'filter> DisplayFilterMatcher<'list, 'filter> {
impl DisplayFilterMatcher<'_, '_> {
pub(crate) fn is_match(&self, test_name: &str) -> bool {
match self {
Self::All => true,
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/reporter/displayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ impl<'a> TestReporterImpl<'a> {
}
}

impl<'a> fmt::Debug for TestReporter<'a> {
impl fmt::Debug for TestReporter<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("TestReporter")
.field("stdout", &"BufferWriter { .. }")
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/reporter/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ some more text at the end, followed by some newlines"#,
#[derive(Eq, PartialEq)]
struct DisplayWrapper<'a>(&'a [u8]);

impl<'a> fmt::Debug for DisplayWrapper<'a> {
impl fmt::Debug for DisplayWrapper<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", String::from_utf8_lossy(self.0))
}
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/reporter/structured/libtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ fn strip_human_stdout_or_combined(
/// <https://github.com/rust-lang/rust/blob/f440b5f0ea042cb2087a36631b20878f9847ee28/library/test/src/formatters/json.rs#L222-L285>
struct EscapedString<'s>(&'s str);

impl<'s> std::fmt::Display for EscapedString<'s> {
impl std::fmt::Display for EscapedString<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut start = 0;
let s = self.0;
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2306,7 +2306,7 @@ struct ContextTestInstance<'a> {
req_tx: UnboundedSender<RunUnitRequest>,
}

impl<'a> ContextTestInstance<'a> {
impl ContextTestInstance<'_> {
fn attempt_failed_will_retry(&mut self, run_status: ExecuteStatus) {
self.past_attempts.push(run_status);
}
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/rustc_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl<'a> RustcCli<'a> {
}
}

impl<'a> Default for RustcCli<'a> {
impl Default for RustcCli<'_> {
fn default() -> Self {
Self {
rustc_path: rustc_path(),
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/test_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ pub struct TestFilter<'builder> {
partitioner: Option<Box<dyn Partitioner>>,
}

impl<'filter> TestFilter<'filter> {
impl TestFilter<'_> {
/// Returns an enum describing the match status of this filter.
pub fn filter_match(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion nextest-runner/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ pub struct MuktiUpdateContext<'a> {
pub perform_setup: bool,
}

impl<'a> MuktiUpdateContext<'a> {
impl MuktiUpdateContext<'_> {
/// Performs the update.
pub fn do_update(&self) -> Result<(), UpdateError> {
// This method is adapted from self_update's update_extended.
Expand Down

0 comments on commit 2c4b51a

Please sign in to comment.