Skip to content

Commit

Permalink
del inverted cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
lucky committed Oct 14, 2024
1 parent 85acbf8 commit df0dec5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "am-rate-bot"
version = "0.21.0"
version = "0.22.0"
edition = "2021"
authors = ["lucky"]

Expand Down
16 changes: 3 additions & 13 deletions src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ enum Command {
UsdEur,
#[command(description = "<FROM> <TO>", parse_with = "split")]
FromTo { from: String, to: String },
#[command(description = "<FROM> <TO> inverted", parse_with = "split")]
FromToInv { from: String, to: String },
#[command(description = "<SOURCE>")]
Get { src: Source },
#[command(description = "AMD/USD cash (֏ - $)")]
Expand All @@ -228,8 +226,6 @@ enum Command {
UsdEurCash,
#[command(description = "<FROM> <TO> cash", parse_with = "split")]
FromToCash { from: String, to: String },
#[command(description = "<FROM> <TO> cash inverted", parse_with = "split")]
FromToCashInv { from: String, to: String },
#[command(description = "<SOURCE> cash")]
GetCash { src: Source },
#[command(description = "list sources")]
Expand Down Expand Up @@ -397,21 +393,15 @@ async fn command(
)
.await?
}
Command::FromTo { ref from, ref to }
| Command::FromToInv { ref from, ref to }
| Command::FromToCash { ref from, ref to }
| Command::FromToCashInv { ref from, ref to } => {
Command::FromTo { ref from, ref to } | Command::FromToCash { ref from, ref to } => {
from_to_repl(
Currency::new(from),
Currency::new(to),
match cmd {
Command::FromToCash { .. } | Command::FromToCashInv { .. } => RateType::Cash,
Command::FromToCash { .. } => RateType::Cash,
_ => RateType::NoCash,
},
match cmd {
Command::FromToInv { .. } | Command::FromToCashInv { .. } => 1,
_ => 0,
},
0,
bot,
msg,
db,
Expand Down

0 comments on commit df0dec5

Please sign in to comment.