mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-10 20:40:05 -06:00
Refactor model for strict Clippy checks
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user