@@ -46,28 +46,28 @@ fn test_inner<T: BinaryHeap + Default + super::VecLike<Element = usize> + std::f
46
46
let mut subject = T :: default ( ) ;
47
47
let mut reference = Vec :: new ( ) ;
48
48
49
- log:: debug!( "max_len = {}, bytecode len = {}" , max_len , bytecode. len( ) ) ;
49
+ log:: debug!( "max_len = {max_len }, bytecode len = {}" , bytecode. len( ) ) ;
50
50
51
51
for cmd in interpret ( & bytecode, max_len) {
52
- log:: trace!( " {:?}" , cmd ) ;
52
+ log:: trace!( " {cmd :?}" ) ;
53
53
match cmd {
54
54
Cmd :: Insert ( value) => {
55
55
let i = subject. heap_push ( value, Ctx ) ;
56
- log:: trace!( " → {}" , i ) ;
56
+ log:: trace!( " → {i}" ) ;
57
57
58
58
let i = reference. binary_search ( & value) . unwrap_or_else ( |x| x) ;
59
59
reference. insert ( i, value) ;
60
60
}
61
61
Cmd :: Remove ( i) => {
62
62
let out_subject = subject. heap_remove ( i, Ctx ) . unwrap ( ) ;
63
- log:: trace!( " → {}" , out_subject ) ;
63
+ log:: trace!( " → {out_subject}" ) ;
64
64
65
65
let i_ref = reference. binary_search ( & out_subject) . unwrap ( ) ;
66
66
reference. remove ( i_ref) ;
67
67
}
68
68
}
69
- log:: trace!( "[sorted: {:?}]" , reference ) ;
70
- log:: trace!( "[subject: {:?}]" , subject ) ;
69
+ log:: trace!( "[sorted: {reference :?}]" ) ;
70
+ log:: trace!( "[subject: {subject :?}]" ) ;
71
71
if subject. len ( ) > 0 {
72
72
assert_eq ! ( subject[ 0 ] , reference[ 0 ] ) ;
73
73
}
@@ -120,7 +120,7 @@ impl BinaryHeapCtx<El> for TrackingCtx<'_> {
120
120
121
121
fn on_move ( & mut self , e : & mut El , new_index : usize ) {
122
122
self . el_position [ e. id ] = Some ( new_index) ;
123
- log:: trace!( " on_move{ :?}" , ( e , new_index) ) ;
123
+ log:: trace!( " on_move({e :?}, { new_index})" ) ;
124
124
}
125
125
}
126
126
@@ -135,29 +135,29 @@ fn position_tracking(bytecode: Vec<u8>) {
135
135
log:: debug!( "bytecode len = {}" , bytecode. len( ) ) ;
136
136
137
137
for cmd in interpret ( & bytecode, usize:: MAX ) {
138
- log:: trace!( " {:?}" , cmd ) ;
138
+ log:: trace!( " {cmd :?}" ) ;
139
139
match cmd {
140
140
Cmd :: Insert ( value) => {
141
141
let id = el_position. len ( ) ;
142
142
el_position. push ( None ) ;
143
143
let i = subject. heap_push ( El { value, id } , TrackingCtx { el_position } ) ;
144
- log:: trace!( " → {}" , i ) ;
144
+ log:: trace!( " → {i}" ) ;
145
145
146
146
// `on_move` should have reported the position for the
147
147
// newly-inserted element
148
148
assert_eq ! ( el_position[ id] , Some ( i) ) ;
149
149
}
150
150
Cmd :: Remove ( i) => {
151
151
let out_subject = subject. heap_remove ( i, TrackingCtx { el_position } ) . unwrap ( ) ;
152
- log:: trace!( " → {:?}" , out_subject ) ;
152
+ log:: trace!( " → {out_subject :?}" ) ;
153
153
154
154
// For a removed element, we must modify `el_position` manually
155
155
el_position[ out_subject. id ] = None ;
156
156
}
157
157
}
158
158
159
- log:: trace!( "[subject: {:?}]" , subject ) ;
160
- log:: trace!( "[el_position: {:?}]" , el_position ) ;
159
+ log:: trace!( "[subject: {subject :?}]" ) ;
160
+ log:: trace!( "[el_position: {el_position :?}]" ) ;
161
161
162
162
// Check if `el_position` correctly represents
163
163
// the current state of `subject`
0 commit comments