-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
219: Support i128 and u128 r=kvark a=e00E This PR adds support for 128 bit integers. RON does not support 128 bit integers. This is undocumented. The Readme wrongly claims that the full Serde data model is supported. Co-authored-by: Valentin Kettner <vakevk+git@gmail.com>
- Loading branch information
Showing
8 changed files
with
163 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize)] | ||
struct S { | ||
a: i8, | ||
b: i16, | ||
c: i32, | ||
d: i64, | ||
e: i128, | ||
f: u8, | ||
g: u16, | ||
h: u32, | ||
i: u64, | ||
j: u128, | ||
} | ||
|
||
#[test] | ||
fn roundtrip() { | ||
let s = S { | ||
a: i8::MIN, | ||
b: i16::MIN, | ||
c: i32::MIN, | ||
d: i64::MIN, | ||
e: i128::MIN, | ||
f: u8::MAX, | ||
g: u16::MAX, | ||
h: u32::MAX, | ||
i: u64::MAX, | ||
j: u128::MAX, | ||
}; | ||
let serialized = ron::ser::to_string(&s).unwrap(); | ||
dbg!(&serialized); | ||
let deserialized = ron::de::from_str(&serialized).unwrap(); | ||
assert_eq!(s, deserialized,); | ||
} |