Another project
0

Configure Feed

Select the types of activity you want to include in your feed.

style(document): fmt io modules, undo test

Lewis: May this revision serve well! <lu5a@proton.me>

author
Lewis
date (Jun 5, 2026, 7:26 PM +0300) commit 7a7f5369 parent 78f1eb90 change-id uywklppm
+33 -11
+5 -1
crates/bone-document/src/io/folder.rs
··· 235 235 .map(sketch_filename) 236 236 .collect(); 237 237 remove_stale_files(&folder.sketches_dir(), &live_sketches)?; 238 - let live_extrudes = tree_extrudes.iter().copied().map(extrude_filename).collect(); 238 + let live_extrudes = tree_extrudes 239 + .iter() 240 + .copied() 241 + .map(extrude_filename) 242 + .collect(); 239 243 remove_stale_files(&folder.extrudes_dir(), &live_extrudes)?; 240 244 241 245 Ok(())
+7 -2
crates/bone-document/src/io/solid.rs
··· 304 304 brep_after.ino(), 305 305 "a present brep blob keeps its inode because the rewrite is skipped" 306 306 ); 307 - assert_eq!(labels_meta.ino(), labels_after.ino(), "a present sidecar is not rewritten"); 307 + assert_eq!( 308 + labels_meta.ino(), 309 + labels_after.ino(), 310 + "a present sidecar is not rewritten" 311 + ); 308 312 } 309 313 310 314 #[test] ··· 315 319 let Ok(_hash) = write_solid(&folder, &solid) else { 316 320 panic!("write solid"); 317 321 }; 318 - let Ok(gitattributes) = std::fs::read_to_string(folder.path().join(".gitattributes")) else { 322 + let Ok(gitattributes) = std::fs::read_to_string(folder.path().join(".gitattributes")) 323 + else { 319 324 panic!(".gitattributes must exist so .brep/.labels are declared text eol=lf"); 320 325 }; 321 326 assert!(gitattributes.contains("*.brep text eol=lf"));
+12 -4
crates/bone-document/src/io/tess.rs
··· 142 142 143 143 fn cylinder() -> BrepSolid { 144 144 let mut entities: SlotMap<SketchEntityId, ()> = SlotMap::with_key(); 145 - let Ok(disk) = Circle2::new(Point2::from_mm(0.0, 0.0), Length::new::<millimeter>(5.0), TOL) 146 - else { 145 + let Ok(disk) = Circle2::new( 146 + Point2::from_mm(0.0, 0.0), 147 + Length::new::<millimeter>(5.0), 148 + TOL, 149 + ) else { 147 150 panic!("positive radius"); 148 151 }; 149 152 solid( ··· 253 256 }; 254 257 255 258 let Ok(None) = read_tessellation(&folder, hash, chord, angle) else { 256 - panic!("a reproducible-from-source cache entry that no longer parses must read as a miss"); 259 + panic!( 260 + "a reproducible-from-source cache entry that no longer parses must read as a miss" 261 + ); 257 262 }; 258 263 assert!( 259 264 !path.exists(), ··· 298 303 else { 299 304 panic!("read fine"); 300 305 }; 301 - assert_eq!(coarse, restored_coarse, "coarse tier survives the fine write"); 306 + assert_eq!( 307 + coarse, restored_coarse, 308 + "coarse tier survives the fine write" 309 + ); 302 310 assert_eq!(fine, restored_fine); 303 311 } 304 312
+9 -4
crates/bone-document/tests/undo.rs
··· 1 1 use std::num::NonZeroUsize; 2 2 3 - use bone_document::{Document, EditOutcome, FeatureEdge, Sketch, SketchEdit, SketchEntity, UndoStack}; 3 + use bone_document::{ 4 + Document, EditOutcome, FeatureEdge, Sketch, SketchEdit, SketchEntity, UndoStack, 5 + }; 4 6 use bone_kernel::{ 5 7 ExtrudeDirection, ExtrudeEndCondition, ExtrudeFeature, ExtrudeSense, MergeResult, 6 8 }; ··· 200 202 }) 201 203 .for_each(drop); 202 204 std::iter::from_fn(|| { 203 - stack 204 - .redo(&mut live) 205 - .then(|| assert!(stack.past_len() <= 2, "redo must not grow past beyond capacity")) 205 + stack.redo(&mut live).then(|| { 206 + assert!( 207 + stack.past_len() <= 2, 208 + "redo must not grow past beyond capacity" 209 + ); 210 + }) 206 211 }) 207 212 .for_each(drop); 208 213 assert!(!stack.can_redo());