diff --git a/src/element.rs b/src/element.rs index b484561..4e174ba 100644 --- a/src/element.rs +++ b/src/element.rs @@ -77,7 +77,6 @@ impl ScanNode { impl PartialEq for ScanNode { fn eq(&self, other: &Node) -> bool { - println!("PartialEq for ScanNode:\n{:?}\n{:?}", self, other); match (&self.node, other) { (Node::Text(text1), Node::Text(text2)) => { text1 == text2 @@ -124,13 +123,10 @@ fn filter_whitespace_nodes(nodes: Vec) -> Vec { .into_iter() .fold((None::, vec![]), filter_nodes).1; - println!("filter_whitespace_nodes: {:?}", nodes); // Don't remove possibly significant whitespace text leaves if nodes.iter().count() == 1 { - println!("Count: 1"); nodes } else { - println!("Count: plus"); nodes .into_iter() .filter(rm_empty_text) @@ -221,11 +217,6 @@ impl<'a> PartialEq<&Element> for ScanElement<'a> { if self.elem.name() == other.name() && self_ns == other.ns() { - println!("FOO0: {{{}}}{}", self.elem.ns(), self.elem.name()); - for attr in self.elem.attrs() { - println!("FOO1: attr: {:?}", attr); - } - let strict_attr = self.elem.attr("scansion:strict"); // Force true if scansion:strict is set or if a tag isn't in the default ns. @@ -234,20 +225,17 @@ impl<'a> PartialEq<&Element> for ScanElement<'a> { } else { self_ns != DEFAULT_NS }; - println!("FOO: Strict: {:?}", strict); for (attr, val) in self.elem.attrs() { - println!("FOO: Attr: {} / {}", attr, val); match (attr, other.attr(attr)) { (attr, _) if attr == "scansion:strict" => continue, (_, None) => return false, (_, Some(oval)) if val != oval => return false, - foo => println!("FOO: {:?}", foo), + _ => (), } } let onodes = other.nodes().cloned().collect::>(); - println!("FOO-2: foo2 {:?}", onodes); // Compare attributes count if strict { @@ -261,11 +249,9 @@ impl<'a> PartialEq<&Element> for ScanElement<'a> { } let nodes = ScanNodes::new_strict(self.elem.nodes().cloned().collect()); - println!("FOO-1: foo1 {:?}", nodes); nodes == onodes } else { - let nodes = ScanNodes::::new(self.elem.nodes().cloned().collect()); - println!("FOO-1: foo1 {:?}", nodes); + let nodes = ScanNodes::new(self.elem.nodes().cloned().collect()); nodes == onodes } } else { @@ -361,11 +347,9 @@ mod tests { let elem2: Element = " ".parse().unwrap(); - println!("BAR0: {:?}", elem2); let elem3: Element = " ".parse().unwrap(); - println!("BAR1: {:?}", elem3); let scan2 = ScanElement::new(&elem2); assert_eq!(scan2, &elem3); @@ -408,12 +392,10 @@ mod tests { ".parse().unwrap(); - println!("BAR0: {:?}", elem1); let elem2: Element = " ".parse().unwrap(); - println!("BAR1: {:?}", elem2); let scan1 = ScanElement::new(&elem1); assert_ne!(scan1, &elem2);