Skip to content

Commit 45fe0a3

Browse files
committed
Passing tests
1 parent 57fa5ce commit 45fe0a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/map_identity.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn get_map_argument<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr<'a>) -> Option<
7676
}
7777

7878
/// Checks if an expression represents the identity function
79-
/// Only examines closures and std::convert::identity
79+
/// Only examines closures and `std::convert::identity`
8080
fn is_expr_identity_function(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
8181
match expr.kind {
8282
ExprKind::Closure(_, _, body_id, _, _) => is_body_identity_function(cx, cx.tcx.hir().body(body_id)),
@@ -86,8 +86,8 @@ fn is_expr_identity_function(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool
8686
}
8787

8888
/// Checks if a function's body represents the identity function
89-
/// Looks for bodies of the form |x| x, |x| return x, |x| return x;, |x| { return x } or |x| {
90-
/// return x; }
89+
/// Looks for bodies of the form `|x| x`, `|x| return x`, `|x| { return x }` or `|x| {
90+
/// return x; }`
9191
fn is_body_identity_function(cx: &LateContext<'_, '_>, func: &Body<'_>) -> bool {
9292
let params = func.params;
9393
let body = remove_blocks(&func.value);

0 commit comments

Comments
 (0)