@@ -44,7 +44,7 @@ impl TreeSink for Sink {
4444 }
4545
4646 fn parse_error ( & self , msg : Cow < ' static , str > ) {
47- println ! ( "Parse error: {}" , msg ) ;
47+ println ! ( "Parse error: {msg}" ) ;
4848 }
4949
5050 fn get_document ( & self ) -> usize {
@@ -62,7 +62,7 @@ impl TreeSink for Sink {
6262 }
6363
6464 fn set_quirks_mode ( & self , mode : QuirksMode ) {
65- println ! ( "Set quirks mode to {:?}" , mode ) ;
65+ println ! ( "Set quirks mode to {mode :?}" ) ;
6666 }
6767
6868 fn same_node ( & self , x : & usize , y : & usize ) -> bool {
@@ -77,7 +77,7 @@ impl TreeSink for Sink {
7777
7878 fn create_element ( & self , name : QualName , _: Vec < Attribute > , _: ElementFlags ) -> usize {
7979 let id = self . get_id ( ) ;
80- println ! ( "Created {:?} as {}" , name , id ) ;
80+ println ! ( "Created {name :?} as {id}" ) ;
8181 // N.B. We intentionally leak memory here to minimize the implementation complexity
8282 // of this example code. A real implementation would either want to use a real
8383 // real DOM tree implentation, or else use an arena as the backing store for
@@ -101,14 +101,14 @@ impl TreeSink for Sink {
101101
102102 fn append ( & self , parent : & usize , child : NodeOrText < usize > ) {
103103 match child {
104- AppendNode ( n) => println ! ( "Append node {} to {}" , n , parent ) ,
104+ AppendNode ( n) => println ! ( "Append node {n } to {parent}" ) ,
105105 AppendText ( t) => println ! ( "Append text to {}: \" {}\" " , parent, t. escape_default( ) ) ,
106106 }
107107 }
108108
109109 fn append_before_sibling ( & self , sibling : & usize , new_node : NodeOrText < usize > ) {
110110 match new_node {
111- AppendNode ( n) => println ! ( "Append node {} before {}" , n , sibling ) ,
111+ AppendNode ( n) => println ! ( "Append node {n } before {sibling}" ) ,
112112 AppendText ( t) => println ! ( "Append text before {}: \" {}\" " , sibling, t. escape_default( ) ) ,
113113 }
114114 }
@@ -128,12 +128,12 @@ impl TreeSink for Sink {
128128 public_id : StrTendril ,
129129 system_id : StrTendril ,
130130 ) {
131- println ! ( "Append doctype: {} {} {}" , name , public_id , system_id ) ;
131+ println ! ( "Append doctype: {name } {public_id } {system_id}" ) ;
132132 }
133133
134134 fn add_attrs_if_missing ( & self , target : & usize , attrs : Vec < Attribute > ) {
135135 assert ! ( self . names. borrow( ) . contains_key( target) , "not an element" ) ;
136- println ! ( "Add missing attributes to {}:" , target ) ;
136+ println ! ( "Add missing attributes to {target }:" ) ;
137137 for attr in attrs. into_iter ( ) {
138138 println ! ( " {:?} = {}" , attr. name, attr. value) ;
139139 }
@@ -149,23 +149,23 @@ impl TreeSink for Sink {
149149 }
150150
151151 fn remove_from_parent ( & self , target : & usize ) {
152- println ! ( "Remove {} from parent" , target ) ;
152+ println ! ( "Remove {target } from parent" ) ;
153153 }
154154
155155 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}" ) ;
157157 }
158158
159159 fn mark_script_already_started ( & self , node : & usize ) {
160- println ! ( "Mark script {} as already started" , node ) ;
160+ println ! ( "Mark script {node } as already started" ) ;
161161 }
162162
163163 fn set_current_line ( & self , line_number : u64 ) {
164- println ! ( "Set current line to {}" , line_number ) ;
164+ println ! ( "Set current line to {line_number}" ) ;
165165 }
166166
167167 fn pop ( & self , elem : & usize ) {
168- println ! ( "Popped element {}" , elem ) ;
168+ println ! ( "Popped element {elem}" ) ;
169169 }
170170}
171171
0 commit comments