diff --git a/minidom-rs/src/element.rs b/minidom-rs/src/element.rs index 9041166..fdd4dd1 100644 --- a/minidom-rs/src/element.rs +++ b/minidom-rs/src/element.rs @@ -1093,7 +1093,7 @@ mod tests { assert_eq!(elem.name(), String::from("bar")); assert_eq!(elem.ns(), String::from("ns1")); // Ensure the prefix is properly added to the store - assert_eq!(elem.prefixes.get(Some(String::from("foo"))), Some(&String::from("ns1"))); + assert_eq!(elem.prefixes.get(&Some(String::from("foo"))), Some(&String::from("ns1"))); } #[test] diff --git a/minidom-rs/src/prefixes.rs b/minidom-rs/src/prefixes.rs index e6bb0d5..0406e2b 100644 --- a/minidom-rs/src/prefixes.rs +++ b/minidom-rs/src/prefixes.rs @@ -49,8 +49,8 @@ impl Prefixes { &self.prefixes } - pub fn get(&self, prefix: Prefix) -> Option<&Namespace> { - self.prefixes.get(&prefix) + pub fn get(&self, prefix: &Prefix) -> Option<&Namespace> { + self.prefixes.get(prefix) } pub(crate) fn insert>(&mut self, prefix: Prefix, namespace: S) {