From 1d958e8a52b093c2d7712754fddff4dc93796e62 Mon Sep 17 00:00:00 2001 From: bel Date: Mon, 6 May 2024 22:25:55 -0600 Subject: [PATCH] later --- pttodoer/Cargo.lock | 111 +++++++++++++++++++++++++++++++++++++++++++ pttodoer/Cargo.toml | 1 + pttodoer/src/main.rs | 20 ++++---- 3 files changed, 124 insertions(+), 8 deletions(-) diff --git a/pttodoer/Cargo.lock b/pttodoer/Cargo.lock index e22b45c..41ab27c 100644 --- a/pttodoer/Cargo.lock +++ b/pttodoer/Cargo.lock @@ -2,6 +2,117 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "proc-macro2" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +dependencies = [ + "unicode-ident", +] + [[package]] name = "pttodoer" version = "0.1.0" +dependencies = [ + "serde_yaml", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "serde" +version = "1.0.200" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.200" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" diff --git a/pttodoer/Cargo.toml b/pttodoer/Cargo.toml index 56390ea..4ce5496 100644 --- a/pttodoer/Cargo.toml +++ b/pttodoer/Cargo.toml @@ -6,3 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +serde_yaml = "0.9.34" diff --git a/pttodoer/src/main.rs b/pttodoer/src/main.rs index 9710412..659b2d4 100644 --- a/pttodoer/src/main.rs +++ b/pttodoer/src/main.rs @@ -1,21 +1,24 @@ +use serde_yaml; + fn main() { - println!("{:?}", Task{todo: "x".to_string(), when: None, detail: None, sub: vec![]}) + println!("{:?}", Task::new()) } #[derive(Debug)] -struct Task { - pub todo: String, - pub when: Option, - pub detail: Option, - pub sub: Vec, -} +struct Task(serde_yaml::Mapping); + //pub todo: String, + //pub when: Option, + //pub detail: Option, + //pub sub: Vec, impl Task { fn is_due(&self) -> bool { - self.when.is_none() || self.when.clone().unwrap().is_due() + assert!(false); + false } } +/* #[derive(Debug, Clone)] struct When(String); @@ -25,3 +28,4 @@ impl When { false } } +*/