mirror of https://github.com/rust-lang/rust.git
This commit is contained in:
parent
48a9ed9b33
commit
228f06a960
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "clippy"
|
name = "clippy"
|
||||||
version = "0.0.8"
|
version = "0.0.9"
|
||||||
authors = [
|
authors = [
|
||||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||||
"Andre Bogus <bogusandre@gmail.com>"
|
"Andre Bogus <bogusandre@gmail.com>"
|
||||||
|
|
|
@ -144,7 +144,7 @@ fn has_is_empty(cx: &Context, expr: &Expr) -> bool {
|
||||||
ty::TyProjection(_) => ty.ty_to_def_id().map_or(false,
|
ty::TyProjection(_) => ty.ty_to_def_id().map_or(false,
|
||||||
|id| has_is_empty_impl(cx, &id)),
|
|id| has_is_empty_impl(cx, &id)),
|
||||||
ty::TyEnum(ref id, _) | ty::TyStruct(ref id, _) =>
|
ty::TyEnum(ref id, _) | ty::TyStruct(ref id, _) =>
|
||||||
has_is_empty_impl(cx, id),
|
has_is_empty_impl(cx, &id.did),
|
||||||
ty::TyArray(..) => true,
|
ty::TyArray(..) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,8 @@ impl LintPass for StringAdd {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_string(cx: &Context, e: &Expr) -> bool {
|
fn is_string(cx: &Context, e: &Expr) -> bool {
|
||||||
if let TyStruct(def_id, _) = walk_ty(cx.tcx.expr_ty(e)).sty {
|
if let TyStruct(did, _) = walk_ty(cx.tcx.expr_ty(e)).sty {
|
||||||
match_def_path(cx, def_id, &["std", "string", "String"])
|
match_def_path(cx, did.did, &["std", "string", "String"])
|
||||||
} else { false }
|
} else { false }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue