about summary refs log tree commit diff
path: root/users/wpcarro/scratch/rust/src/main.rs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2022-08-09T17·20-0700
committerclbot <clbot@tvl.fyi>2022-08-09T17·22+0000
commit4732603a42c76ea53ab6a4d7358380f4d0194c48 (patch)
tree97d79231f08d99dd89cae79d799c6c48bd5b1bd6 /users/wpcarro/scratch/rust/src/main.rs
parent783e1190cdbc1a5fe60f5c5cc1dc3a9861ee138f (diff)
feat(wpcarro/rust): Include std::fmt::Display example r/4396
Gotta know how to `to_string` things

Change-Id: I259ef61ecaf6ae7fabe0b3d211706ba5f429b3a7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6057
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/wpcarro/scratch/rust/src/main.rs')
-rw-r--r--users/wpcarro/scratch/rust/src/main.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/users/wpcarro/scratch/rust/src/main.rs b/users/wpcarro/scratch/rust/src/main.rs
new file mode 100644
index 000000000000..da9e3d3c637c
--- /dev/null
+++ b/users/wpcarro/scratch/rust/src/main.rs
@@ -0,0 +1,18 @@
+use serde::{Deserialize, Serialize};
+use serde_json::{json, Value};
+
+mod display;
+mod json;
+
+////////////////////////////////////////////////////////////////////////////////
+// Main
+////////////////////////////////////////////////////////////////////////////////
+
+fn main() {
+    let john: display::Person = display::Person {
+        fname: "John".to_string(),
+        lname: "Cleese".to_string(),
+        age: 82,
+    };
+    println!("Person: {}", john)
+}