]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/methods.rs
#3006 : Fixing for .get().unwrap().foo()
[rust.git] / clippy_lints / src / methods.rs
index 03e3d2628e842c17876042ef9007dc9fef6be49e..32e6a83e535d3d09120b4e798897d306203487d1 100644 (file)
@@ -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, "_")