]> git.lizzy.rs Git - rust.git/commitdiff
Remove unused qualifications
authorSeo Sanghyeon <sanxiyn@gmail.com>
Fri, 27 Nov 2015 15:47:24 +0000 (00:47 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Wed, 2 Dec 2015 14:25:12 +0000 (23:25 +0900)
src/bit_mask.rs
src/mut_mut.rs
src/mut_reference.rs

index ab73086d07bfa155b80c12118c0775662f90cbbc..bee99b0f7834fe748f90c355a8e24b34937a2d9a 100644 (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
     }
 }
index 09ba7d781a26635f272baff68c2af001b6f7d8f0..c361ab2483120a2ab98eef5b28463ea3e4bac044 100644 (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 unwrap_addr(expr: &Expr) -> Option<&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
     }
 }
index 86c272affb77afea869a98999a0f363942f065b7..e9601e8650f1142395c57944df4bc702102ef7e8 100644 (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",