Skip to content

Commit 1ba8ed9

Browse files
committed
Fix dogfood
1 parent 65ff2df commit 1ba8ed9

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

clippy_lints/src/lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<'v, 't> RefVisitor<'v, 't> {
241241

242242
fn collect_anonymous_lifetimes(&mut self, qpath: &QPath, ty: &Ty) {
243243
let last_path_segment = &last_path_segment(qpath).parameters;
244-
if let &AngleBracketedParameters(ref params) = last_path_segment {
244+
if let AngleBracketedParameters(ref params) = *last_path_segment {
245245
if params.lifetimes.is_empty() {
246246
match self.cx.tcx.tables().qpath_def(qpath, ty.id) {
247247
Def::TyAlias(def_id) |

clippy_lints/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl LateLintPass for TypePass {
7777
if let TyPath(ref qpath) = ast_ty.node {
7878
let def = cx.tcx.tables().qpath_def(qpath, ast_ty.id);
7979
if let Some(def_id) = opt_def_id(def) {
80-
if def_id == cx.tcx.lang_items.owned_box().unwrap() {
80+
if Some(def_id) == cx.tcx.lang_items.owned_box() {
8181
let last = last_path_segment(qpath);
8282
if_let_chain! {[
8383
let PathParameters::AngleBracketedParameters(ref ag) = last.parameters,

clippy_lints/src/utils/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool {
159159
let mut apb = AbsolutePathBuffer { names: vec![] };
160160

161161
cx.tcx.push_item_path(&mut apb, def_id);
162-
if path == paths::VEC_FROM_ELEM {
163-
println!("{:#?} == {:#?}", apb.names, path);
164-
}
165162

166163
apb.names.len() == path.len() &&
167164
apb.names.iter().zip(path.iter()).all(|(a, &b)| &**a == b)
@@ -214,15 +211,15 @@ pub fn last_path_segment(path: &QPath) -> &PathSegment {
214211
QPath::Resolved(_, ref path) => path.segments
215212
.last()
216213
.expect("A path must have at least one segment"),
217-
QPath::TypeRelative(_, ref seg) => &seg,
214+
QPath::TypeRelative(_, ref seg) => seg,
218215
}
219216
}
220217

221218
pub fn single_segment_path(path: &QPath) -> Option<&PathSegment> {
222219
match *path {
223220
QPath::Resolved(_, ref path) if path.segments.len() == 1 => Some(&path.segments[0]),
224221
QPath::Resolved(..) => None,
225-
QPath::TypeRelative(_, ref seg) => Some(&seg),
222+
QPath::TypeRelative(_, ref seg) => Some(seg),
226223
}
227224
}
228225

0 commit comments

Comments
 (0)