Skip to content

Commit

Permalink
Tidy up formatting and alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
mqudsi committed Apr 27, 2024
1 parent 9ffc4c8 commit 6537ee3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/tweet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ fn main() {
// Serialize and and deserialize from byte values or strings
let _: File = serde_json::from_str(
r#"{
"name": "Hello.txt",
"size": "12.92 gigabytes",
"disk_size": 12920000000
}"#,
"name": "Hello.txt",
"size": "12.92 gigabytes",
"disk_size": 12920000000
}"#,
)
.unwrap();
}
3 changes: 1 addition & 2 deletions src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ impl<'de> de::Visitor<'de> for SizeVisitor {
where
E: de::Error,
{
Size::from_str(value)
.map_err(|_| E::custom(format!("Invalid size: \"{value}\"")))
Size::from_str(value).map_err(|_| E::custom(format!("Invalid size: \"{value}\"")))
}
}

Expand Down

0 comments on commit 6537ee3

Please sign in to comment.