diff --git a/forest/src/cli/mod.rs b/forest/src/cli/mod.rs index 480be5da1a1..97766a500b3 100644 --- a/forest/src/cli/mod.rs +++ b/forest/src/cli/mod.rs @@ -48,9 +48,9 @@ use utils::{read_file_to_string, read_toml}; about = env!("CARGO_PKG_DESCRIPTION"), author = env!("CARGO_PKG_AUTHORS") )] -pub struct CLI { +pub struct Cli { #[structopt(flatten)] - pub opts: CLIOpts, + pub opts: CliOpts, #[structopt(subcommand)] pub cmd: Option, } @@ -87,7 +87,7 @@ pub enum Subcommand { /// CLI options #[derive(StructOpt, Debug)] -pub struct CLIOpts { +pub struct CliOpts { #[structopt(short, long, help = "A toml file containing relevant configurations")] pub config: Option, #[structopt(short, long, help = "The genesis CAR file")] @@ -137,7 +137,7 @@ pub struct CLIOpts { pub encrypt_keystore: Option, } -impl CLIOpts { +impl CliOpts { pub fn to_config(&self) -> Result { let mut cfg: Config = match &self.config { Some(config_file) => { diff --git a/forest/src/main.rs b/forest/src/main.rs index e52a40a35f4..50d0e8f2d84 100644 --- a/forest/src/main.rs +++ b/forest/src/main.rs @@ -6,14 +6,14 @@ mod daemon; mod logger; mod subcommand; -use cli::{cli_error_and_die, CLI}; +use cli::{cli_error_and_die, Cli}; use structopt::StructOpt; #[async_std::main] async fn main() { logger::setup_logger(); - // Capture CLI inputs - let CLI { opts, cmd } = CLI::from_args(); + // Capture Cli inputs + let Cli { opts, cmd } = Cli::from_args(); // Run forest as a daemon if no other subcommands are used. Otherwise, run the subcommand. match opts.to_config() { diff --git a/node/rpc-client/src/lib.rs b/node/rpc-client/src/lib.rs index 75809d2df4d..af9a4d3da8b 100644 --- a/node/rpc-client/src/lib.rs +++ b/node/rpc-client/src/lib.rs @@ -78,17 +78,17 @@ pub enum JsonRpcResponse { }, } -struct URL { +struct Url { protocol: String, port: String, host: String, } -/// Parses a multiaddress into a URL +/// Parses a multiaddress into a Url fn multiaddress_to_url(multiaddr: Multiaddr) -> String { - // Fold Multiaddress into a URL struct + // Fold Multiaddress into a Url struct let addr = multiaddr.into_iter().fold( - URL { + Url { protocol: DEFAULT_PROTOCOL.to_owned(), port: DEFAULT_PORT.to_owned(), host: DEFAULT_HOST.to_owned(),