From 95da97ab1b028ac563f5f055e11fca4ab2282672 Mon Sep 17 00:00:00 2001 From: Nathan F Yospe Date: Thu, 6 Oct 2022 14:53:23 -0400 Subject: [PATCH 1/3] Update to clap 4.0 --- Cargo.toml | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dcbcb0cd..77b160c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ ark-serialize = "0.3.0" async-std = { version = "1.8.0", features = ["attributes"] } async-trait = "0.1.51" bincode = "1.3.3" -clap = { version = "3.2.5", features = ["derive"] } +clap = { version = "4.0", features = ["derive"] } config = "0.13.1" derive_more = "0.99" dirs = "4.0.0" diff --git a/src/lib.rs b/src/lib.rs index 4a00908b..d5cfe64f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -544,8 +544,8 @@ fn get_cmd_line_map() -> config::Environment { let mut cla = HashMap::new(); let matches = Args::command().get_matches(); for arg in Args::command().get_arguments() { - if let Some(value) = matches.get_one::(arg.get_id()) { - let key = arg.get_id().replace('-', "_"); + if let Some(value) = matches.get_one::(arg.get_id().as_str()) { + let key = arg.get_id().as_str().replace('-', "_"); cla.insert(key, value.to_owned()); } } From 99bbbd5c5174149f7d13a862dc426e108915be11 Mon Sep 17 00:00:00 2001 From: Nathan F Yospe Date: Thu, 6 Oct 2022 15:19:46 -0400 Subject: [PATCH 2/3] DiscoArgs will always be embedded. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d5cfe64f..d8ed1b4e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -237,7 +237,7 @@ use crate::ApiKey::*; use async_std::sync::{Arc, RwLock}; use async_std::task::sleep; -use clap::{CommandFactory, Parser}; +use clap::{Args, CommandFactory, Parser}; use config::{Config, ConfigError}; use routefinder::Router; use serde::Deserialize; @@ -281,7 +281,7 @@ pub const SERVER_STARTUP_RETRIES: u64 = 255; /// Number of milliseconds to sleep between attempts pub const SERVER_STARTUP_SLEEP_MS: u64 = 100; -#[derive(Parser, Debug)] +#[derive(clap::Args, Debug)] #[clap(author, version, about, long_about = None)] pub struct DiscoArgs { #[clap(long)] From 718bf107c0d6d999192dfeba8e5a7829b7896ade Mon Sep 17 00:00:00 2001 From: Nathan F Yospe Date: Thu, 6 Oct 2022 16:04:24 -0400 Subject: [PATCH 3/3] finally, move to the updated tagged-base64 --- Cargo.toml | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 77b160c0..b3b6aff3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ snafu = { version = "0.7", features = ["backtraces"] } strum = "0.20" strum_macros = "0.20.1" surf = "2.3.2" -tagged-base64 = { git = "https://github.com/EspressoSystems/tagged-base64.git", tag = "0.2.0" } +tagged-base64 = { git = "https://github.com/EspressoSystems/tagged-base64.git", tag = "0.2.1" } tide = { version = "0.16.0", default-features = false } tide-websockets = "0.4.0" toml = "0.5" diff --git a/src/lib.rs b/src/lib.rs index d8ed1b4e..0152290d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -237,7 +237,7 @@ use crate::ApiKey::*; use async_std::sync::{Arc, RwLock}; use async_std::task::sleep; -use clap::{Args, CommandFactory, Parser}; +use clap::CommandFactory; use config::{Config, ConfigError}; use routefinder::Router; use serde::Deserialize;