1
1
//! Element references.
2
2
3
- use std:: fmt;
3
+ use std:: fmt:: { self , Debug } ;
4
4
use std:: ops:: Deref ;
5
5
6
6
use ego_tree:: iter:: { Edge , Traverse } ;
@@ -15,7 +15,7 @@ use crate::{Node, Selector};
15
15
///
16
16
/// This wrapper implements the `Element` trait from the `selectors` crate, which allows it to be
17
17
/// matched against CSS selectors.
18
- #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
18
+ #[ derive( Clone , Copy , PartialEq , Eq ) ]
19
19
pub struct ElementRef < ' a > {
20
20
node : NodeRef < ' a , Node > ,
21
21
}
@@ -116,6 +116,12 @@ impl<'a> ElementRef<'a> {
116
116
}
117
117
}
118
118
119
+ impl < ' a > Debug for ElementRef < ' a > {
120
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
121
+ Debug :: fmt ( self . value ( ) , f)
122
+ }
123
+ }
124
+
119
125
impl < ' a > Deref for ElementRef < ' a > {
120
126
type Target = NodeRef < ' a , Node > ;
121
127
fn deref ( & self ) -> & NodeRef < ' a , Node > {
@@ -131,7 +137,7 @@ pub struct Select<'a, 'b> {
131
137
nth_index_cache : NthIndexCache ,
132
138
}
133
139
134
- impl fmt :: Debug for Select < ' _ , ' _ > {
140
+ impl Debug for Select < ' _ , ' _ > {
135
141
fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
136
142
fmt. debug_struct ( "Select" )
137
143
. field ( "scope" , & self . scope )
0 commit comments