Refactor model for strict Clippy checks

This commit is contained in:
Dylan M. Taylor
2026-10-28 10:52:53 +00:00
parent 7898cc8cfd
commit 95fcdcc2ca
8 changed files with 55 additions and 41 deletions
+4 -3
View File
@@ -27,7 +27,7 @@ mod tests {
use gridcraft_core::CellRef;
#[test]
fn comments_and_hyperlinks_survive_json() {
fn comments_and_hyperlinks_survive_json() -> Result<(), Box<dyn std::error::Error>> {
let mut s = Sheet::new("S");
let a1 = CellRef::new(0, 0);
let c3 = CellRef::new(2, 2);
@@ -45,9 +45,10 @@ mod tests {
},
);
s.hyperlinks.insert(c3, Hyperlink { target: "Sheet1!A1".into(), tooltip: Some("jump".into()), external: false });
let json = serde_json::to_string(&s).expect("serialize");
let back: Sheet = serde_json::from_str(&json).expect("deserialize");
let json = serde_json::to_string(&s)?;
let back: Sheet = serde_json::from_str(&json)?;
assert_eq!(back.comments, s.comments);
assert_eq!(back.hyperlinks, s.hyperlinks);
Ok(())
}
}