Skip to content

Commit 9713b26

Browse files
authored
Add additional check to ensure generic type resolution is only for generics (#904)
1 parent 613b3ad commit 9713b26

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utoipa-gen/src/component.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ impl<'t> TypeTree<'t> {
270270

271271
// TODO should we recognize unknown generic types with `GenericType::Unknown` instead of `None`?
272272
fn get_generic_type(segment: &PathSegment) -> Option<GenericType> {
273+
if segment.arguments.is_empty() {
274+
return None;
275+
}
276+
273277
match &*segment.ident.to_string() {
274278
"HashMap" | "Map" | "BTreeMap" => Some(GenericType::Map),
275279
#[cfg(feature = "indexmap")]

0 commit comments

Comments
 (0)