Skip to content
Snippets Groups Projects
Commit 02087065 authored by Ron Williams's avatar Ron Williams Committed by Jeremy Soller
Browse files

don't panic when adding an existing name to a namespace

parent 036a4bde
No related branches found
No related tags found
No related merge requests found
...@@ -188,7 +188,9 @@ impl SchemeList { ...@@ -188,7 +188,9 @@ impl SchemeList {
}; };
if let Some(ref mut names) = self.names.get_mut(&to) { if let Some(ref mut names) = self.names.get_mut(&to) {
assert!(names.insert(name.to_string().into_boxed_str(), id).is_none()); if names.insert(name.to_string().into_boxed_str(), id).is_some() {
return Err(Error::new(EEXIST));
}
} else { } else {
panic!("scheme namespace not found"); panic!("scheme namespace not found");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment