@@ -161,7 +161,10 @@ impl From<Vec<i64>> for Segment {
161161 let mut data = [ 0i64 ; 5 ] ;
162162 let len = v. len ( ) . min ( 5 ) ;
163163 data[ ..len] . copy_from_slice ( & v[ ..len] ) ;
164- Self { data, len : len as u8 }
164+ Self {
165+ data,
166+ len : len as u8 ,
167+ }
165168 }
166169}
167170
@@ -170,7 +173,10 @@ impl From<&[i64]> for Segment {
170173 let mut data = [ 0i64 ; 5 ] ;
171174 let len = s. len ( ) . min ( 5 ) ;
172175 data[ ..len] . copy_from_slice ( & s[ ..len] ) ;
173- Self { data, len : len as u8 }
176+ Self {
177+ data,
178+ len : len as u8 ,
179+ }
174180 }
175181}
176182
@@ -251,7 +257,10 @@ mod tests {
251257
252258 #[ test]
253259 fn roundtrip_negative_deltas ( ) {
254- let mappings = vec ! [ vec![ Segment :: four( 10 , 0 , 10 , 10 ) , Segment :: four( 20 , 0 , 5 , 5 ) ] ] ;
260+ let mappings = vec ! [ vec![
261+ Segment :: four( 10 , 0 , 10 , 10 ) ,
262+ Segment :: four( 20 , 0 , 5 , 5 ) ,
263+ ] ] ;
255264 let encoded = encode ( & mappings) ;
256265 let decoded = decode ( & encoded) . unwrap ( ) ;
257266 assert_eq ! ( decoded, mappings) ;
@@ -379,14 +388,22 @@ mod tests {
379388 fn encode_empty_segments_no_dangling_comma ( ) {
380389 // Empty segments should be skipped without producing dangling commas
381390 let empty = Segment :: from ( & [ ] as & [ i64 ] ) ;
382- let mappings = vec ! [ vec![ empty, Segment :: four( 0 , 0 , 0 , 0 ) , empty, Segment :: four( 2 , 0 , 0 , 1 ) ] ] ;
391+ let mappings = vec ! [ vec![
392+ empty,
393+ Segment :: four( 0 , 0 , 0 , 0 ) ,
394+ empty,
395+ Segment :: four( 2 , 0 , 0 , 1 ) ,
396+ ] ] ;
383397 let encoded = encode ( & mappings) ;
384398 assert ! (
385399 !encoded. contains( ",," ) ,
386400 "should not contain dangling commas"
387401 ) ;
388402 // Should encode as if empty segments don't exist
389- let expected = encode ( & vec ! [ vec![ Segment :: four( 0 , 0 , 0 , 0 ) , Segment :: four( 2 , 0 , 0 , 1 ) ] ] ) ;
403+ let expected = encode ( & vec ! [ vec![
404+ Segment :: four( 0 , 0 , 0 , 0 ) ,
405+ Segment :: four( 2 , 0 , 0 , 1 ) ,
406+ ] ] ) ;
390407 assert_eq ! ( encoded, expected) ;
391408 }
392409
0 commit comments