Refactor error handling and improve code readability in ServeSession and applyPatch

- Enhanced error logging in ServeSession by formatting warning messages for better clarity.
- Improved readability in applyPatch by restructuring conditional statements for clarity.
- Simplified assertions in tests for script pruning to maintain consistency and readability.

These changes aim to improve code maintainability and enhance the clarity of error messages.
This commit is contained in:
Joe 2026-02-28 06:44:37 -06:00
parent 9820ec6534
commit dcd48642be
5 changed files with 25 additions and 27 deletions

View file

@ -18,10 +18,7 @@ fn scripts_only_read_prunes_non_script_subtrees() {
.map(|inst| inst.name.as_ref())
.collect();
assert!(
names.contains(&"TopScript"),
"TopScript should be included"
);
assert!(names.contains(&"TopScript"), "TopScript should be included");
assert!(
names.contains(&"DeepScript"),
"DeepScript should be included"
@ -31,18 +28,9 @@ fn scripts_only_read_prunes_non_script_subtrees() {
"SomeScript should be included"
);
assert!(
!names.contains(&"PartA"),
"PartA should be pruned"
);
assert!(
!names.contains(&"PartB"),
"PartB should be pruned"
);
assert!(
!names.contains(&"SomeModel"),
"SomeModel should be pruned"
);
assert!(!names.contains(&"PartA"), "PartA should be pruned");
assert!(!names.contains(&"PartB"), "PartB should be pruned");
assert!(!names.contains(&"SomeModel"), "SomeModel should be pruned");
assert!(
!names.contains(&"PureParts"),
"PureParts folder should be pruned (no script descendants)"