]> git.lizzy.rs Git - rust.git/commitdiff
fix
authork-nasa <htilcs1115@gmail.com>
Wed, 13 Oct 2021 14:07:49 +0000 (23:07 +0900)
committerk-nasa <htilcs1115@gmail.com>
Wed, 13 Oct 2021 14:07:49 +0000 (23:07 +0900)
crates/ide_assists/src/utils.rs

index 22221afe74f86ec1dbc91cf420c7440aa620c8dc..ea7edadfe95ec7e61c7eceb73bfd4b0007be5593 100644 (file)
@@ -310,9 +310,9 @@ fn calc_depth(pat: &ast::Pat, depth: usize) -> usize {
         | ast::Pat::RefPat(_)
         | ast::Pat::SlicePat(_)
         | ast::Pat::TuplePat(_)
-        | ast::Pat::ConstBlockPat(_) => 1,
+        | ast::Pat::ConstBlockPat(_) => depth,
 
-        // TODO: Other patterns may also be nested. Currently it simply supports only `TupleStructPat`
+        // FIXME: Other patterns may also be nested. Currently it simply supports only `TupleStructPat`
         ast::Pat::TupleStructPat(pat) => {
             let mut max_depth = depth;
             for p in pat.fields() {