diff --git a/CHANGELOG.md b/CHANGELOG.md index cd3bfdf..f386e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Address input parameter for fn `process` in `impl`s + ### Changed ### Deprecated diff --git a/src/address.rs b/src/address.rs index 13e0f0d..b35ab28 100644 --- a/src/address.rs +++ b/src/address.rs @@ -13,7 +13,7 @@ pub enum Address { } impl Address { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { Address::IsAvailable => todo!(), Address::GetExpiry => todo!(), diff --git a/src/dns.rs b/src/dns.rs index 553547f..59c1abb 100644 --- a/src/dns.rs +++ b/src/dns.rs @@ -22,12 +22,12 @@ pub enum Dns { } impl Dns { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { Dns::GetRecords => todo!(), - Dns::AddRecord { json_data } => todo!(), - Dns::UpdateRecord { json_data } => todo!(), - Dns::DeleteRecord { id } => todo!(), + Dns::AddRecord { json_data: _ } => todo!(), + Dns::UpdateRecord { json_data: _ } => todo!(), + Dns::DeleteRecord { id: _ } => todo!(), } } } diff --git a/src/email.rs b/src/email.rs index 328ecbb..c445a1c 100644 --- a/src/email.rs +++ b/src/email.rs @@ -12,10 +12,10 @@ pub enum Email { } impl Email { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { Email::GetForwards => todo!(), - Email::SetForwards { json_data } => todo!(), + Email::SetForwards { json_data: _ } => todo!(), } } } diff --git a/src/lib.rs b/src/lib.rs index b62496c..be0d89b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,13 +36,13 @@ pub enum Commands { }, /// Get information and make changes to your addresses Address { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] command: Address, }, - /// Save your omg.lol API key to the config.json (Rather than using the OMGLOL_API_KEY environment variable) + /// Save your omg.lol API key to the config.json (Rather than using the env. var: OMGLOL_API_KEY) Auth { /// API key to save to config.json api_key: String, @@ -51,7 +51,7 @@ pub enum Commands { Directory, /// Adjust the switchboard / DNS records for your omg.lol address Dns { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -59,7 +59,7 @@ pub enum Commands { }, /// Manage the email configuration for an omg.lol address Email { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -67,7 +67,7 @@ pub enum Commands { }, /// Manage your /now page Now { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -75,7 +75,7 @@ pub enum Commands { }, /// Manage the pastebin for an omg.lol address Pastebin { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -92,7 +92,7 @@ pub enum Commands { }, /// Manage PURLs (Persistent URLs) for your omg.lol address Purl { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -102,7 +102,7 @@ pub enum Commands { Service, /// Manage the statuslog for an omg.lol address Status { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -110,7 +110,7 @@ pub enum Commands { }, /// Manage omg.lol profile themes Theme { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -118,7 +118,7 @@ pub enum Commands { }, /// Manage profile page and web stuff for an omg.lol address Web { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -126,7 +126,7 @@ pub enum Commands { }, /// Manage the weblog for an omg.lol address Weblog { - /// omg.lol address to interact with + /// omg.lol address to interact with, overrides config and env. var: (OMGLOL_USERNAME) #[clap(short, long, global = true)] address: Option, #[clap(subcommand)] @@ -135,25 +135,24 @@ pub enum Commands { } impl Commands { - fn process(&self) { + // TBD: Is there a more idiomatic / succinct approach to this? + pub fn process(&self, _address: &Option) { match self { - Commands::Account { email, command } => { - command.process(email); - } - Commands::Address { address, command } => todo!(), - Commands::Auth { api_key } => todo!(), + Commands::Account { email, command } => command.process(email), + Commands::Address { address, command } => command.process(address), + Commands::Auth { api_key: _ } => todo!(), Commands::Directory => todo!(), - Commands::Dns { address, command } => todo!(), - Commands::Email { address, command } => todo!(), - Commands::Now { address, command } => todo!(), - Commands::Pastebin { address, command } => todo!(), - Commands::Preferences { owner, item, value } => todo!(), - Commands::Purl { address, command } => todo!(), + Commands::Dns { address, command } => command.process(address), + Commands::Email { address, command } => command.process(address), + Commands::Now { address, command } => command.process(address), + Commands::Pastebin { address, command } => command.process(address), + Commands::Preferences { owner: _, item: _, value: _ } => todo!(), + Commands::Purl { address, command } => command.process(address), Commands::Service => todo!(), - Commands::Status { address, command } => todo!(), - Commands::Theme { address, command } => todo!(), - Commands::Web { address, command } => todo!(), - Commands::Weblog { address, command } => todo!(), + Commands::Status { address, command } => command.process(address), + Commands::Theme { address, command } => command.process(address), + Commands::Web { address, command } => command.process(address), + Commands::Weblog { address, command } => command.process(address), } } } diff --git a/src/now.rs b/src/now.rs index 1fcaf04..4cd3650 100644 --- a/src/now.rs +++ b/src/now.rs @@ -17,11 +17,11 @@ pub enum Now { } impl Now { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { Now::Get => todo!(), Now::List => todo!(), - Now::Set { content, listed } => todo!(), + Now::Set { content: _, listed: _ } => todo!(), } } } diff --git a/src/pastebin.rs b/src/pastebin.rs index 95d2710..69ffd50 100644 --- a/src/pastebin.rs +++ b/src/pastebin.rs @@ -26,13 +26,13 @@ pub enum Pastebin { } impl Pastebin { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { - Pastebin::Get { name } => todo!(), + Pastebin::Get { name: _ } => todo!(), Pastebin::GetAll => todo!(), Pastebin::GetAllPublic => todo!(), - Pastebin::Set { name, content } => todo!(), - Pastebin::Delete { name } => todo!(), + Pastebin::Set { name: _, content: _ } => todo!(), + Pastebin::Delete { name: _ } => todo!(), } } } diff --git a/src/purl.rs b/src/purl.rs index e1d9a3b..b8c0b89 100644 --- a/src/purl.rs +++ b/src/purl.rs @@ -24,12 +24,12 @@ pub enum Purl { } impl Purl { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { - Purl::Create { name, url } => todo!(), - Purl::Get { name } => todo!(), + Purl::Create { name: _, url: _ } => todo!(), + Purl::Get { name: _ } => todo!(), Purl::List => todo!(), - Purl::Delete { name } => todo!(), + Purl::Delete { name: _ } => todo!(), } } } diff --git a/src/status.rs b/src/status.rs index 3b9e1ef..b8f1e0a 100644 --- a/src/status.rs +++ b/src/status.rs @@ -47,15 +47,15 @@ pub enum Status { } impl Status { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { - Status::Get { id } => todo!(), + Status::Get { id: _ } => todo!(), Status::GetAll => todo!(), - Status::Create { emoji, content, external_url } => todo!(), - Status::EasyCreate { status } => todo!(), - Status::Update { id, emoji, content } => todo!(), + Status::Create { emoji: _, content: _, external_url: _ } => todo!(), + Status::EasyCreate { status: _ } => todo!(), + Status::Update { id: _, emoji: _, content: _ } => todo!(), Status::GetBio => todo!(), - Status::SetBio { content } => todo!(), + Status::SetBio { content: _ } => todo!(), Status::GetAllHistorical => todo!(), Status::Timeline => todo!(), } diff --git a/src/theme.rs b/src/theme.rs index 49e3ef2..8ea9e2b 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -17,11 +17,11 @@ pub enum Theme { } impl Theme { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { Theme::List => todo!(), - Theme::Info { id } => todo!(), - Theme::Preview { id } => todo!(), + Theme::Info { id: _ } => todo!(), + Theme::Preview { id: _ } => todo!(), } } } diff --git a/src/web.rs b/src/web.rs index 15db3bf..582a0d4 100644 --- a/src/web.rs +++ b/src/web.rs @@ -22,7 +22,7 @@ pub enum Web { } impl Web { - pub fn process(&self) { + pub fn process(&self, _address: &Option) { match self { Web::Get => todo!(), Web::Set { content: _, publish: _ } => todo!(),