@@ -44,7 +44,7 @@ impl TreeSink for Sink {
44
44
}
45
45
46
46
fn parse_error ( & self , msg : Cow < ' static , str > ) {
47
- println ! ( "Parse error: {}" , msg ) ;
47
+ println ! ( "Parse error: {msg}" ) ;
48
48
}
49
49
50
50
fn get_document ( & self ) -> usize {
@@ -62,7 +62,7 @@ impl TreeSink for Sink {
62
62
}
63
63
64
64
fn set_quirks_mode ( & self , mode : QuirksMode ) {
65
- println ! ( "Set quirks mode to {:?}" , mode ) ;
65
+ println ! ( "Set quirks mode to {mode :?}" ) ;
66
66
}
67
67
68
68
fn same_node ( & self , x : & usize , y : & usize ) -> bool {
@@ -77,7 +77,7 @@ impl TreeSink for Sink {
77
77
78
78
fn create_element ( & self , name : QualName , _: Vec < Attribute > , _: ElementFlags ) -> usize {
79
79
let id = self . get_id ( ) ;
80
- println ! ( "Created {:?} as {}" , name , id ) ;
80
+ println ! ( "Created {name :?} as {id}" ) ;
81
81
// N.B. We intentionally leak memory here to minimize the implementation complexity
82
82
// of this example code. A real implementation would either want to use a real
83
83
// real DOM tree implentation, or else use an arena as the backing store for
@@ -101,14 +101,14 @@ impl TreeSink for Sink {
101
101
102
102
fn append ( & self , parent : & usize , child : NodeOrText < usize > ) {
103
103
match child {
104
- AppendNode ( n) => println ! ( "Append node {} to {}" , n , parent ) ,
104
+ AppendNode ( n) => println ! ( "Append node {n } to {parent}" ) ,
105
105
AppendText ( t) => println ! ( "Append text to {}: \" {}\" " , parent, t. escape_default( ) ) ,
106
106
}
107
107
}
108
108
109
109
fn append_before_sibling ( & self , sibling : & usize , new_node : NodeOrText < usize > ) {
110
110
match new_node {
111
- AppendNode ( n) => println ! ( "Append node {} before {}" , n , sibling ) ,
111
+ AppendNode ( n) => println ! ( "Append node {n } before {sibling}" ) ,
112
112
AppendText ( t) => println ! ( "Append text before {}: \" {}\" " , sibling, t. escape_default( ) ) ,
113
113
}
114
114
}
@@ -128,12 +128,12 @@ impl TreeSink for Sink {
128
128
public_id : StrTendril ,
129
129
system_id : StrTendril ,
130
130
) {
131
- println ! ( "Append doctype: {} {} {}" , name , public_id , system_id ) ;
131
+ println ! ( "Append doctype: {name } {public_id } {system_id}" ) ;
132
132
}
133
133
134
134
fn add_attrs_if_missing ( & self , target : & usize , attrs : Vec < Attribute > ) {
135
135
assert ! ( self . names. borrow( ) . contains_key( target) , "not an element" ) ;
136
- println ! ( "Add missing attributes to {}:" , target ) ;
136
+ println ! ( "Add missing attributes to {target }:" ) ;
137
137
for attr in attrs. into_iter ( ) {
138
138
println ! ( " {:?} = {}" , attr. name, attr. value) ;
139
139
}
@@ -149,23 +149,23 @@ impl TreeSink for Sink {
149
149
}
150
150
151
151
fn remove_from_parent ( & self , target : & usize ) {
152
- println ! ( "Remove {} from parent" , target ) ;
152
+ println ! ( "Remove {target } from parent" ) ;
153
153
}
154
154
155
155
fn reparent_children ( & self , node : & usize , new_parent : & usize ) {
156
- println ! ( "Move children from {} to {}" , node , new_parent ) ;
156
+ println ! ( "Move children from {node } to {new_parent}" ) ;
157
157
}
158
158
159
159
fn mark_script_already_started ( & self , node : & usize ) {
160
- println ! ( "Mark script {} as already started" , node ) ;
160
+ println ! ( "Mark script {node } as already started" ) ;
161
161
}
162
162
163
163
fn set_current_line ( & self , line_number : u64 ) {
164
- println ! ( "Set current line to {}" , line_number ) ;
164
+ println ! ( "Set current line to {line_number}" ) ;
165
165
}
166
166
167
167
fn pop ( & self , elem : & usize ) {
168
- println ! ( "Popped element {}" , elem ) ;
168
+ println ! ( "Popped element {elem}" ) ;
169
169
}
170
170
}
171
171
0 commit comments