mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 14:57:59 +00:00
Use slicing syntax instead of .as_slice()
This commit is contained in:
@@ -24,7 +24,7 @@ fn test_json_struct() {
|
||||
};
|
||||
|
||||
let s = serde::json::to_string(&input).unwrap();
|
||||
assert_eq!(s.as_slice(), r#"{"$schema":"a","title":"b","type":3}"#);
|
||||
assert_eq!(&s[], r#"{"$schema":"a","title":"b","type":3}"#);
|
||||
|
||||
let output: Test = serde::json::from_str(&s).unwrap();
|
||||
assert_eq!(input, output);
|
||||
|
||||
Reference in New Issue
Block a user