Remove unused qualifications

This commit is contained in:
Seo Sanghyeon 2015-11-28 00:47:24 +09:00
parent b45745e905
commit 26f539eaa3
3 changed files with 9 additions and 9 deletions

View file

@ -183,8 +183,8 @@ fn fetch_int_literal(cx: &LateContext, lit : &Expr) -> Option<u64> {
match lit.node {
ExprLit(ref lit_ptr) => {
if let LitInt(value, _) = lit_ptr.node {
Option::Some(value) //TODO: Handle sign
} else { Option::None }
Some(value) //TODO: Handle sign
} else { None }
}
ExprPath(_, _) => {
// Important to let the borrow expire before the const lookup to avoid double
@ -195,8 +195,8 @@ fn fetch_int_literal(cx: &LateContext, lit : &Expr) -> Option<u64> {
_ => None
}
}
.and_then(|def_id| lookup_const_by_id(cx.tcx, def_id, Option::None))
.and_then(|def_id| lookup_const_by_id(cx.tcx, def_id, None))
.and_then(|l| fetch_int_literal(cx, l)),
_ => Option::None
_ => None
}
}

View file

@ -33,8 +33,8 @@ fn check_expr_mut(cx: &LateContext, expr: &Expr) {
fn unwrap_addr(expr: &Expr) -> Option<&Expr> {
match expr.node {
ExprAddrOf(MutMutable, ref e) => Option::Some(e),
_ => Option::None
ExprAddrOf(MutMutable, ref e) => Some(e),
_ => None
}
}
@ -58,7 +58,7 @@ fn check_expr_mut(cx: &LateContext, expr: &Expr) {
fn unwrap_mut(ty: &Ty) -> Option<&Ty> {
match ty.node {
TyRptr(_, MutTy{ ty: ref pty, mutbl: MutMutable }) => Option::Some(pty),
_ => Option::None
TyRptr(_, MutTy{ ty: ref pty, mutbl: MutMutable }) => Some(pty),
_ => None
}
}

View file

@ -60,7 +60,7 @@ fn check_arguments(cx: &LateContext, arguments: &[P<Expr>], type_definition: &Ty
match parameter.sty {
TypeVariants::TyRef(_, TypeAndMut {ty: _, mutbl: MutImmutable}) |
TypeVariants::TyRawPtr(TypeAndMut {ty: _, mutbl: MutImmutable}) => {
if let Expr_::ExprAddrOf(MutMutable, _) = argument.node {
if let ExprAddrOf(MutMutable, _) = argument.node {
span_lint(cx, UNNECESSARY_MUT_PASSED,
argument.span, &format!("The function/method \"{}\" \
doesn't need a mutable reference",