From ef331333c60e87b16941c4f0a7f401de44756719 Mon Sep 17 00:00:00 2001 From: CaptainSpof Date: Tue, 9 Aug 2022 14:44:45 +0200 Subject: [PATCH 1/2] - chore(rustc): update rust to 1.62.1 - chore(deps): bump flakes --- flake.lock | 52 ++++++++++++++++++++++++-------------------------- toolchain.toml | 2 +- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/flake.lock b/flake.lock index ce2885e..26b531c 100644 --- a/flake.lock +++ b/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1650900878, - "narHash": "sha256-qhNncMBSa9STnhiLfELEQpYC1L4GrYHNIzyCZ/pilsI=", + "lastModified": 1658746384, + "narHash": "sha256-CCJcoMOcXyZFrV1ag4XMTpAPjLWb4Anbv+ktXFI1ry0=", "owner": "numtide", "repo": "devshell", - "rev": "d97df53b5ddaa1cfbea7cddbd207eb2634304733", + "rev": "0ffc7937bb5e8141af03d462b468bd071eb18e1b", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "flake-utils_2": { "locked": { - "lastModified": 1649676176, - "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -51,11 +51,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1637014545, - "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "owner": "numtide", "repo": "flake-utils", - "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "type": "github" }, "original": { @@ -69,11 +69,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1651574473, - "narHash": "sha256-wQhFORvRjo8LB2hTmETmv6cbyKGDPbfWqvZ/0chnDE4=", + "lastModified": 1659610603, + "narHash": "sha256-LYgASYSPYo7O71WfeUOaEUzYfzuXm8c8eavJcel+pfI=", "owner": "nmattia", "repo": "naersk", - "rev": "f21309b38e1da0d61b881b6b6d41b81c1aed4e1d", + "rev": "c6a45e4277fa58abd524681466d3450f896dc094", "type": "github" }, "original": { @@ -100,12 +100,10 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1651927509, - "narHash": "sha256-fGVGUdEsriuAL1vkUh29FlOQmEkPRnSfRGImWYaVjos=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "2fdb6f2e08e7989b03a2a1aa8538d99e3eeea881", - "type": "github" + "lastModified": 0, + "narHash": "sha256-Koz6/k7c6hx4qVz/bboxdR2QsBdkxjRWpNmsOWJtXZE=", + "path": "/nix/store/xcqwhl9v7khiqcfv1bf3dx7cydrp4075-source", + "type": "path" }, "original": { "id": "nixpkgs", @@ -114,11 +112,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1651726670, - "narHash": "sha256-dSGdzB49SEvdOJvrQWfQYkAefewXraHIV08Vz6iDXWQ=", + "lastModified": 1659981942, + "narHash": "sha256-uCFiP/B/NXOWzhN6TKfMbSxtVMk1bVnCrnJRjCF6RmU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c777cdf5c564015d5f63b09cc93bef4178b19b01", + "rev": "39d7f929fbcb1446ad7aa7441b04fb30625a4190", "type": "github" }, "original": { @@ -130,11 +128,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1637453606, - "narHash": "sha256-Gy6cwUswft9xqsjWxFYEnx/63/qzaFUwatcbV5GF/GQ=", + "lastModified": 1659102345, + "narHash": "sha256-Vbzlz254EMZvn28BhpN8JOi5EuKqnHZ3ujFYgFcSGvk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8afc4e543663ca0a6a4f496262cd05233737e732", + "rev": "11b60e4f80d87794a2a4a8a256391b37c59a1ea7", "type": "github" }, "original": { @@ -159,11 +157,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1651977622, - "narHash": "sha256-M3vm6mz+ypilmw3hkA6/GyDHH7ID85jWqeE9rtPWe8k=", + "lastModified": 1660013452, + "narHash": "sha256-V6FAvuW2VDyuy7Bqe4nULfmTsADGmYxSrQ3++crjIVQ=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "c66fab76467a5df683ef50724a7bde54c315f967", + "rev": "8efc449efb21b4fdf9ba35ce41644fd603a7fd6e", "type": "github" }, "original": { diff --git a/toolchain.toml b/toolchain.toml index 948d27d..77c704f 100644 --- a/toolchain.toml +++ b/toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.60.0" +channel = "1.62.1" From 862aece52a74ec808c152fe1c78582a6e142806e Mon Sep 17 00:00:00 2001 From: CaptainSpof Date: Tue, 9 Aug 2022 16:06:32 +0200 Subject: [PATCH 2/2] refactor(clap): fix clap 3.2 warning --- cli/src/config.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/cli/src/config.rs b/cli/src/config.rs index 3631d82..a3983bb 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -16,50 +16,51 @@ pub struct Config { #[clap( short, long, - parse(from_occurrences), + action = clap::ArgAction::Count, long_help = "-v:\t\tINFO|WARN|ERROR\n-vv:\tINFO|WARN|ERROR|DEBUG\n-vvv:\tINFO|WARN|ERROR|DEBUG|TRACE" )] pub verbose: u8, /// The length of the list to be returned - #[clap(short, env = "RR_NB_RESULT", default_value = "10")] + #[clap(short, env = "RR_NB_RESULT", default_value = "10", action)] pub number: usize, /// Path to the themes files // TODO: respect XDG convention - #[clap(long, env = "RR_THEMES_PATH", default_value = "./dict/themes")] + #[clap(long, env = "RR_THEMES_PATH", default_value = "./dict/themes", action)] pub themes_path: PathBuf, /// A list of themes to be chosen from /// /// Themes preceded by '!' will be excluded - #[clap(short, long)] + #[clap(short, long, action)] pub themes: Vec, /// Path to the adjectives files // TODO: respect XDG convention - #[clap(long, env = "RR_ADJS_PATH", default_value = "./dict/adjectives")] + #[clap(long, env = "RR_ADJS_PATH", default_value = "./dict/adjectives", action)] pub adjectives_path: PathBuf, /// A list of adjectives to be chosen from - #[clap(short, long)] + #[clap(short, long, action)] pub adjs: Vec, /// Provide a template from which to generate words // FIXME: use custom rr filter - #[clap(long, default_value = "{{ adj }} {{ theme }}")] + #[clap(long, default_value = "{{ adj }} {{ theme }}", action)] #[deprecated(note = "Replaced with `templates`")] pub template: String, /// Provide templates from which to generate words - #[clap(short = 'T', long, default_value = "{{ adj | rr }} {{ theme | rr }}")] + #[clap(short = 'T', long, default_value = "{{ adj | rr }} {{ theme | rr }}", action)] pub templates: Vec, /// try the legacy version - #[clap(short, long)] + #[clap(short, long, action)] pub legacy: bool, /// The pattern to start with + #[clap(action)] pub pattern: Option, /// cmd @@ -81,15 +82,17 @@ pub enum Command { #[derive(Parser, Debug)] pub struct Edit { /// Provide a theme + #[clap(action)] pub theme: String, /// Provide a list of entries /// /// Will attempt to read from stdin + #[clap(action)] entries: Vec, /// Work against adjectif - #[clap(short)] + #[clap(short, action)] pub adjs: bool, }