diff options
author | tilpner | 2018-09-25 16:29:49 +0200 |
---|---|---|
committer | tilpner | 2018-09-25 16:30:17 +0200 |
commit | 498d9c36e4d55de478e180cd81845989ddd80eda (patch) | |
tree | 7acc75719223e74e08c23d7071d1376013928859 /hello/src | |
parent | 040ec873821d23e168a59b7ee21697fe0af5bb4c (diff) | |
download | carnix-cross-498d9c36e4d55de478e180cd81845989ddd80eda.tar.gz carnix-cross-498d9c36e4d55de478e180cd81845989ddd80eda.tar.xz carnix-cross-498d9c36e4d55de478e180cd81845989ddd80eda.zip |
Diffstat (limited to 'hello/src')
-rw-r--r-- | hello/src/main.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/hello/src/main.rs b/hello/src/main.rs index e7a11a9..e5ad212 100644 --- a/hello/src/main.rs +++ b/hello/src/main.rs @@ -1,3 +1,15 @@ +extern crate serde; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; + +#[derive(Serialize)] +struct Foo { + bar: i32 +} + fn main() { - println!("Hello, world!"); + let s = serde_json::to_string(&Foo { bar: 42 }) + .expect("Unable to serialize foo"); + println!("{}", s); } |