about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/rustdoc.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-11 17:23:56 -0400
committerMichael Goulet <michael@errs.io>2024-09-11 17:24:01 -0400
commitaf8d911d63d6b38ea2da36a330b035dd2e6f89a7 (patch)
treead39949e1071a021f16e808ecf00f6148dd0d488 /compiler/rustc_resolve/src/rustdoc.rs
parent954419aab01264707f116899e77be682b02764ea (diff)
downloadrust-af8d911d63d6b38ea2da36a330b035dd2e6f89a7.tar.gz
rust-af8d911d63d6b38ea2da36a330b035dd2e6f89a7.zip
Also fix if in else
Diffstat (limited to 'compiler/rustc_resolve/src/rustdoc.rs')
-rw-r--r--compiler/rustc_resolve/src/rustdoc.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs
index 976c4acb212..bed3baa30fb 100644
--- a/compiler/rustc_resolve/src/rustdoc.rs
+++ b/compiler/rustc_resolve/src/rustdoc.rs
@@ -270,12 +270,10 @@ fn strip_generics_from_path_segment(segment: Vec<char>) -> Result<String, Malfor
                 // Give a helpful error message instead of completely ignoring the angle brackets.
                 return Err(MalformedGenerics::HasFullyQualifiedSyntax);
             }
+        } else if param_depth == 0 {
+            stripped_segment.push(c);
         } else {
-            if param_depth == 0 {
-                stripped_segment.push(c);
-            } else {
-                latest_generics_chunk.push(c);
-            }
+            latest_generics_chunk.push(c);
         }
     }