From dae5c9c685b8b7e936b48bedf41ce4f2e6890629 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Sat, 16 Mar 2019 11:17:36 +0100 Subject: [PATCH] AbsolutePathBuffer -> AbsolutePathPrinter --- clippy_lints/src/types.rs | 4 ++-- clippy_lints/src/utils/mod.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index d4c4756e458..4433acf8efd 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -25,7 +25,7 @@ use crate::utils::{ clip, comparisons, differing_macro_contexts, higher, in_constant, in_macro, int_bits, last_path_segment, match_def_path, match_path, multispan_sugg, same_tys, sext, snippet, snippet_opt, snippet_with_applicability, - span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, unsext, AbsolutePathBuffer, + span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, unsext, AbsolutePathPrinter, }; /// Handles all the linting of funky types @@ -1138,7 +1138,7 @@ fn name(&self) -> &'static str { // one of the platform specific `libc::::c_void` of libc. fn is_c_void<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'_>) -> bool { if let ty::Adt(adt, _) = ty.sty { - let names = AbsolutePathBuffer { tcx }.print_def_path(adt.did, &[]).unwrap(); + let names = AbsolutePathPrinter { tcx }.print_def_path(adt.did, &[]).unwrap(); if names.is_empty() { return false; diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index c9c11ef44e4..b46237b57f6 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -98,13 +98,13 @@ pub fn in_macro(span: Span) -> bool { /// Used to store the absolute path to a type. /// /// See `match_def_path` for usage. -pub struct AbsolutePathBuffer<'a, 'tcx> { +pub struct AbsolutePathPrinter<'a, 'tcx> { pub tcx: TyCtxt<'a, 'tcx, 'tcx>, } use rustc::ty::print::Printer; -impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathBuffer<'_, 'tcx> { +impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathPrinter<'_, 'tcx> { type Error = !; type Path = Vec; @@ -201,7 +201,7 @@ fn path_generic_args( /// /// See also the `paths` module. pub fn match_def_path<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId, path: &[&str]) -> bool { - let names = AbsolutePathBuffer { tcx }.print_def_path(def_id, &[]).unwrap(); + let names = AbsolutePathPrinter { tcx }.print_def_path(def_id, &[]).unwrap(); names.len() == path.len() && names.into_iter().zip(path.iter()).all(|(a, &b)| *a == *b) } @@ -216,7 +216,7 @@ pub fn match_def_path<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId, path /// }; /// ``` pub fn get_def_path<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Vec { - AbsolutePathBuffer { tcx }.print_def_path(def_id, &[]).unwrap() + AbsolutePathPrinter { tcx }.print_def_path(def_id, &[]).unwrap() } /// Checks if type is struct, enum or union type with the given def path. -- 2.44.0