about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChen Chen <0109chenchen@gmail.com>2023-09-17 02:42:12 +0800
committerGitHub <noreply@github.com>2023-09-17 02:42:12 +0800
commit3cad6237166dc71e2b75a9e60d5058f2876e1959 (patch)
treeb0ed1b8564046504d3ac56fdcb97e78f8b34be05
parentaf2a8478ba3228ede92ff799b17ac2408fc6347f (diff)
downloadrust-3cad6237166dc71e2b75a9e60d5058f2876e1959.tar.gz
rust-3cad6237166dc71e2b75a9e60d5058f2876e1959.zip
更新 cast_lossless.rs
Co-authored-by: Timo <30553356+y21@users.noreply.github.com>
-rw-r--r--clippy_lints/src/casts/cast_lossless.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/clippy_lints/src/casts/cast_lossless.rs b/clippy_lints/src/casts/cast_lossless.rs
index 2f3ffea6693..c586b572be9 100644
--- a/clippy_lints/src/casts/cast_lossless.rs
+++ b/clippy_lints/src/casts/cast_lossless.rs
@@ -25,14 +25,7 @@ pub(super) fn check(
     // The suggestion is to use a function call, so if the original expression
     // has parens on the outside, they are no longer needed.
     let mut applicability = Applicability::MachineApplicable;
-    let opt = snippet_opt(
-        cx,
-        if cast_op.span.from_expansion() {
-            cast_op.span.source_callsite()
-        } else {
-            cast_op.span
-        },
-    );
+    let opt = snippet_opt(cx, cast_op.span.source_callsite());
     let sugg = opt.as_ref().map_or_else(
         || {
             applicability = Applicability::HasPlaceholders;