Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/bit_mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}
8 changes: 4 additions & 4 deletions src/mut_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
}
}
2 changes: 1 addition & 1 deletion src/mut_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down