From 6473e06042547d9ce70a9e7005f5dfb96377130d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 16 May 2019 02:03:41 +0100 Subject: [PATCH] wip --- macros.fig | 17 +++++++++-------- serde-example.txt | 11 +++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/macros.fig b/macros.fig index 5d9c95f..10e4408 100644 --- a/macros.fig +++ b/macros.fig @@ -7,18 +7,19 @@ A4 Single -2 1200 2 -1 2 0 2 1 7 50 -1 -1 0.000 1 0.0000 3015 -1395 2565 315 450 -1710 5580 -1080 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 -1350 2970 10800 2970 -2 5 0 1 0 -1 60 -1 -1 0.000 0 0 -1 0 0 5 - 0 serde-example.txt.eps - -1170 -2250 11340 -2250 11340 2512 -1170 2512 -1170 -2250 2 5 0 1 0 -1 60 -1 -1 0.000 0 0 -1 0 0 5 0 macro-rules-example.txt.eps -1170 3330 9054 3330 9054 5712 -1170 5712 -1170 3330 -4 0 1 50 -1 0 30 0.0000 4 330 2175 8280 1530 Awesome!\001 +2 5 0 1 0 -1 60 -1 -1 0.000 0 0 -1 0 0 5 + 0 serde-example.txt.eps + -1170 -2250 10785 -2250 10785 2512 -1170 2512 -1170 -2250 +2 2 0 2 1 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 720 -1170 5760 -1170 5760 -1620 720 -1620 720 -1170 4 0 4 50 -1 0 30 0.0000 4 435 7410 3600 5310 What a syntax for something simple!\001 -4 0 1 50 -1 0 27 0.0000 4 420 5085 2520 -270 You can do this in a library!\001 -4 0 1 50 -1 0 27 0.0000 4 315 4800 2520 -720 Not a built in Rust feature.\001 -4 0 1 50 -1 0 24 0.0000 4 360 5520 2520 360 Only Common Lisp can beat this\001 4 0 4 50 -1 0 26 0.0000 4 405 9450 1800 5760 (and this macro doesn't even always work quite right)\001 +4 0 1 50 -1 0 27 0.0000 4 315 4800 5850 -1620 Not a built in Rust feature.\001 +4 0 1 50 -1 0 27 0.0000 4 420 5085 6030 -720 You can do this in a library!\001 +4 0 1 50 -1 0 24 0.0000 4 360 5520 6030 -360 Only Common Lisp can beat this\001 +4 0 1 50 -1 0 30 0.0000 4 330 2175 8280 1890 Awesome!\001 diff --git a/serde-example.txt b/serde-example.txt index c5c2f13..8428397 100644 --- a/serde-example.txt +++ b/serde-example.txt @@ -1,14 +1,13 @@ use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Debug)] -struct Point { - x: i32, - y: i32, -} +struct Point { x: i32, y: i32, } fn main() { let point = Point { x: 1, y: 2 }; // Convert the Point to a JSON string. - let serialized = serde_json::to_string(&point).unwrap(); -... + let j = serde_json::to_string(&point).unwrap(); + + // Parse the JSON string as a Point. + let p2: Point = serde_json::from_str(&j).unwrap(); -- 2.30.2