Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate serde;
- #[macro_use]
- extern crate serde_derive;
- extern crate toml;
- #[derive(Serialize)]
- struct BigInt {
- val: i128,
- }
- fn main() {
- let o = BigInt { val: std::i128::MAX };
- let ser = toml::to_string(&o).unwrap(); //Err
- println!("{}", ser);
- deser(); //comment the serialzing code in order to use that
- }
- fn deser() {
- let t = r#"
- val = 28828373726
- "#
- let o: BigInt = toml::from_str(&t).unwrap();
- println!("{}", o);
- }
Add Comment
Please, Sign In to add comment