@@ -31,7 +31,6 @@ impl<'input> Document<'input> {
3131pub ( super ) struct Node < ' a , ' input > {
3232 inner : roxmltree:: Node < ' a , ' input > ,
3333 children : Peekable < roxmltree:: Children < ' a , ' input > > ,
34- attributes : Attributes < ' a , ' input > ,
3534 src : & ' input str ,
3635}
3736
@@ -112,7 +111,7 @@ impl<'a, 'input> Node<'a, 'input> {
112111 }
113112
114113 pub ( super ) fn attribute_of ( & self , name : & str ) -> Option < & str > {
115- self . attributes . attribute_of ( name)
114+ self . inner . attribute ( name)
116115 }
117116
118117 pub ( super ) fn text ( & self ) -> TextView < ' a , ' input > {
@@ -122,12 +121,9 @@ impl<'a, 'input> Node<'a, 'input> {
122121 fn from_xmltree_node ( node : roxmltree:: Node < ' a , ' input > , src : & ' input str ) -> Self {
123122 debug_assert ! ( node. node_type( ) == roxmltree:: NodeType :: Element ) ;
124123 let children = node. children ( ) . peekable ( ) ;
125- let attributes = Attributes :: from_xmltree_attrs ( node. attributes ( ) ) ;
126-
127124 Self {
128125 inner : node,
129126 children,
130- attributes,
131127 src,
132128 }
133129 }
@@ -141,26 +137,6 @@ impl fmt::Debug for Node<'_, '_> {
141137 }
142138}
143139
144- struct Attributes < ' a , ' input > {
145- attrs : & ' a [ roxmltree:: Attribute < ' input > ] ,
146- }
147-
148- impl < ' a , ' input > Attributes < ' a , ' input > {
149- fn from_xmltree_attrs ( attrs : & ' a [ roxmltree:: Attribute < ' input > ] ) -> Self {
150- Self { attrs }
151- }
152-
153- fn attribute_of ( & self , name : & str ) -> Option < & str > {
154- self . attrs . iter ( ) . find_map ( |attr| {
155- if attr. name ( ) == name {
156- Some ( roxmltree:: Attribute :: value ( attr) )
157- } else {
158- None
159- }
160- } )
161- }
162- }
163-
164140pub ( super ) struct TextView < ' a , ' input > {
165141 inner : roxmltree:: Node < ' a , ' input > ,
166142}
0 commit comments