From c899f92d961cd2b8a113cc161e642a1293bc9ddb Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Sun, 14 May 2023 14:06:00 +0200 Subject: [PATCH] Clippy Signed-off-by: Oliver Tale-Yazdi --- .github/workflows/rust.yml | 2 +- proc-macro-warning/src/lib.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b1d5089..33fd491 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -27,7 +27,7 @@ jobs: run: cargo fmt --all -- --check - name: Check no-std - run: cargo check --no-default-features + run: cargo check --all-targets --no-default-features --locked - name: Build run: cargo build --all-targets --all-features --locked diff --git a/proc-macro-warning/src/lib.rs b/proc-macro-warning/src/lib.rs index b2d511e..dc6010a 100644 --- a/proc-macro-warning/src/lib.rs +++ b/proc-macro-warning/src/lib.rs @@ -72,7 +72,7 @@ impl FormattedWarning { /// .old("my_macro()") /// .new("my_macro::new()") /// .help_link("https:://example.com") -/// // Normally you use the input span, but this is an example: +/// // Normally you use the input span, but this is an example: /// .span(proc_macro2::Span::call_site()) /// .build(); /// @@ -207,12 +207,12 @@ impl Warning { } } -impl Into for Warning { - fn into(self) -> FormattedWarning { - match self { - Self::Deprecated { span, .. } => FormattedWarning::Deprecated { - name: self.final_deprecated_name(), - note: self.final_deprecated_message(), +impl From for FormattedWarning { + fn from(val: Warning) -> Self { + match val { + Warning::Deprecated { span, .. } => FormattedWarning::Deprecated { + name: val.final_deprecated_name(), + note: val.final_deprecated_message(), span: Some(span), }, }