minidom: Don't borrow prefix in Prefixes.get

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2020-03-29 21:25:18 +02:00
parent 1f2d7aa99d
commit 770dff7cb0
2 changed files with 3 additions and 3 deletions

View file

@ -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]

View file

@ -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<S: Into<Namespace>>(&mut self, prefix: Prefix, namespace: S) {