diff --git a/gdn/src/data/v1.rs b/gdn/src/data/v1.rs index 7f80253..8f8825d 100644 --- a/gdn/src/data/v1.rs +++ b/gdn/src/data/v1.rs @@ -38,10 +38,18 @@ impl State { // Otherwise, interpret the identifier as a repo name and find the // corresponding id. - self.repos + let matching = self + .repos .iter() - .find(|(_, name)| *name == identifier) + .filter(|(_, name)| *name == identifier) .map(|(id, _)| *id) + .collect::>(); + + match matching.first() { + None => None, + Some(_) if matching.len() > 1 => None, + Some(id) => Some(*id), + } } }