Skip to content

Commit 64bf2f1

Browse files
committed
Fix tests
1 parent 3922094 commit 64bf2f1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clippy_dev/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ pub fn gen_deprecated(lints: &[Lint]) -> Vec<String> {
123123
lints
124124
.iter()
125125
.filter_map(|l| {
126-
l.clone().deprecation.and_then(|depr_text| {
127-
Some(vec![
126+
l.clone().deprecation.map(|depr_text| {
127+
vec![
128128
" store.register_removed(".to_string(),
129129
format!(" \"clippy::{}\",", l.name),
130130
format!(" \"{}\",", depr_text),
131131
" );".to_string(),
132-
])
132+
]
133133
})
134134
})
135135
.flatten()

clippy_lints/src/methods/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2082,14 +2082,14 @@ fn lint_map_or_none<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr,
20822082

20832083
/// Lint use of `_.and_then(|x| Some(y))` for `Option`s
20842084
fn lint_option_and_then_some(cx: &LateContext<'_, '_>, expr: &hir::Expr, args: &[hir::Expr]) {
2085+
const LINT_MSG: &str = "using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`";
2086+
const NO_OP_MSG: &str = "using `Option.and_then(Some)`, which is no-op";
2087+
20852088
let ty = cx.tables.expr_ty(&args[0]);
20862089
if !match_type(cx, ty, &paths::OPTION) {
20872090
return;
20882091
}
20892092

2090-
const LINT_MSG: &str = "using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`";
2091-
const NO_OP_MSG: &str = "using `Option.and_then(Some)`, which is no-op";
2092-
20932093
match args[1].node {
20942094
hir::ExprKind::Closure(_, _, body_id, closure_args_span, _) => {
20952095
let closure_body = cx.tcx.hir().body(body_id);

0 commit comments

Comments
 (0)