From 7ed1dd52dfffa3bb2ae2367a2e40e4ffe7dad3f4 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 19 Nov 2026 11:25:17 -0800 Subject: [PATCH] :art: Lay out the written ranges' code as rustfmt does rustfmt splits the long asserts of the written-range tests and drops a blank line at the end of the span join; the check fails on its diff otherwise. --- .../src/graphics/decode/surface_cache.rs | 6 ++++-- .../src/graphics/decode/surface_shapes.rs | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/crates/reims-vgpu/src/graphics/decode/surface_cache.rs b/crates/reims-vgpu/src/graphics/decode/surface_cache.rs index 356b0d0d2..326d87ac2 100644 --- a/crates/reims-vgpu/src/graphics/decode/surface_cache.rs +++ b/crates/reims-vgpu/src/graphics/decode/surface_cache.rs @@ -600,7 +600,6 @@ impl Changed { }; spans.splice(first..last, [joined]); } - } /// Of `bytes`, the parts that lie in `spans`, sorted and apart: each of `bytes` cut to them, in @@ -11243,7 +11242,10 @@ pub(super) mod tests { let spans = [100..200, 300..400]; assert_eq!(clip(&spans, &[0..1000]), [100..200, 300..400]); assert_eq!(clip(&spans, &[150..350]), [150..200, 300..350]); - assert_eq!(clip(&spans, &[0..100, 200..300, 400..500]), Vec::>::new()); + assert_eq!( + clip(&spans, &[0..100, 200..300, 400..500]), + Vec::>::new() + ); assert_eq!(clip(&spans, &[120..130, 390..450]), [120..130, 390..400]); assert_eq!(clip(&[], &[0..1000]), Vec::>::new()); } diff --git a/crates/reims-vgpu/src/graphics/decode/surface_shapes.rs b/crates/reims-vgpu/src/graphics/decode/surface_shapes.rs index ea11ef33c..9767dd695 100644 --- a/crates/reims-vgpu/src/graphics/decode/surface_shapes.rs +++ b/crates/reims-vgpu/src/graphics/decode/surface_shapes.rs @@ -1531,8 +1531,15 @@ mod tests { "the first shape's KiB alone" ); let pages = ram_bytes(&r, 1, length, None); - assert!(pages[..1024].iter().all(|&b| b == 0xc3), "the shape's bytes"); - assert_eq!(pages[1024..], before[1024..], "the rest as the pages held them"); + assert!( + pages[..1024].iter().all(|&b| b == 0xc3), + "the shape's bytes" + ); + assert_eq!( + pages[1024..], + before[1024..], + "the rest as the pages held them" + ); let counts = r.dec.caches().counts(); assert_eq!(counts.narrowed, 1); assert_eq!(counts.unwritten_bytes, length - 1024); @@ -1583,7 +1590,11 @@ mod tests { complete_staged(&r); let (back, out) = staged_download(&r, cache, 0x3c); assert_eq!(back, [(first, cache, 0)]); - assert_eq!((out[0].1, out[0].2, out[0].3), (0, 0, 1024), "the shape's alone"); + assert_eq!( + (out[0].1, out[0].2, out[0].3), + (0, 0, 1024), + "the shape's alone" + ); } /// A staged download after a writer that wrote nothing the host copied into the cache's