From 72058a6d0d63fef5705e6f4d040b1dff3ce7affd Mon Sep 17 00:00:00 2001 From: Andre Bogus Date: Fri, 6 Sep 2019 09:40:36 +0200 Subject: [PATCH] Simplify , removing a FIXME --- clippy_lints/src/utils/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index bbf9572f8fb4..321a45322fd2 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -1126,7 +1126,6 @@ mod test { } pub fn match_def_path<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, did: DefId, syms: &[&str]) -> bool { - // HACK: find a way to use symbols from clippy or just go fully to diagnostic items - let syms: Vec<_> = syms.iter().map(|sym| Symbol::intern(sym)).collect(); - cx.match_def_path(did, &syms) + let path = cx.get_def_path(did); + path.len() == syms.len() && path.into_iter().zip(syms.iter()).all(|(a, &b)| a.as_str() == b) }