Skip to content

Commit 2156f67

Browse files
committed
Clean up unused cx parameters
1 parent 3c93a95 commit 2156f67

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clippy_lints/src/unused_io_amount.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedIoAmount {
5050
};
5151

5252
match expr.node {
53-
hir::ExprKind::Match(ref res, _, _) if is_try(cx, expr).is_some() => {
53+
hir::ExprKind::Match(ref res, _, _) if is_try(expr).is_some() => {
5454
if let hir::ExprKind::Call(ref func, ref args) = res.node {
5555
if let hir::ExprKind::Path(ref path) = func.node {
5656
if match_qpath(path, &paths::TRY_INTO_RESULT) && args.len() == 1 {

clippy_lints/src/utils/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,8 @@ pub fn iter_input_pats<'tcx>(decl: &FnDecl, body: &'tcx Body) -> impl Iterator<I
950950

951951
/// Checks if a given expression is a match expression expanded from the `?`
952952
/// operator or the `try` macro.
953-
pub fn is_try<'a>(cx: &'_ LateContext<'_, '_>, expr: &'a Expr) -> Option<&'a Expr> {
954-
fn is_ok(cx: &'_ LateContext<'_, '_>, arm: &Arm) -> bool {
953+
pub fn is_try(expr: &Expr) -> Option<&Expr> {
954+
fn is_ok(arm: &Arm) -> bool {
955955
if_chain! {
956956
if let PatKind::TupleStruct(ref path, ref pat, None) = arm.pats[0].node;
957957
if match_qpath(path, &paths::RESULT_OK[1..]);
@@ -984,8 +984,8 @@ pub fn is_try<'a>(cx: &'_ LateContext<'_, '_>, expr: &'a Expr) -> Option<&'a Exp
984984
if arms.len() == 2;
985985
if arms[0].pats.len() == 1 && arms[0].guard.is_none();
986986
if arms[1].pats.len() == 1 && arms[1].guard.is_none();
987-
if (is_ok(cx, &arms[0]) && is_err(&arms[1])) ||
988-
(is_ok(cx, &arms[1]) && is_err(&arms[0]));
987+
if (is_ok(&arms[0]) && is_err(&arms[1])) ||
988+
(is_ok(&arms[1]) && is_err(&arms[0]));
989989
then {
990990
return Some(expr);
991991
}

0 commit comments

Comments
 (0)