X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=clippy_lints%2Fsrc%2Fmethods.rs;h=32e6a83e535d3d09120b4e798897d306203487d1;hb=de8d233b060f60a37b7fae82a36f7226892ac4e7;hp=03e3d2628e842c17876042ef9007dc9fef6be49e;hpb=bc6d85ceafdec687f3d5c25777a661724cae77de;p=rust.git diff --git a/clippy_lints/src/methods.rs b/clippy_lints/src/methods.rs index 03e3d2628e8..32e6a83e535 100644 --- a/clippy_lints/src/methods.rs +++ b/clippy_lints/src/methods.rs @@ -1431,7 +1431,7 @@ fn lint_get_unwrap(cx: &LateContext<'_, '_>, expr: &hir::Expr, get_args: &[hir:: ), "try this", format!( - "{}{}[{}]", + "({}{}[{}])", borrow_str, snippet(cx, get_args[0].span, "_"), snippet(cx, get_args[1].span, "_")