From 1a5991cd6c32a82b92f576acbf450c67f357886a Mon Sep 17 00:00:00 2001 From: Lucas Pickering Date: Sun, 11 Oct 2020 10:28:28 -0400 Subject: [PATCH] Rename `calc prob` to `calc drop` --- src/commands/calc/{prob.rs => drop.rs} | 6 +++--- src/commands/calc/mod.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/commands/calc/{prob.rs => drop.rs} (98%) diff --git a/src/commands/calc/prob.rs b/src/commands/calc/drop.rs similarity index 98% rename from src/commands/calc/prob.rs rename to src/commands/calc/drop.rs index 9ac1803..0bcc162 100644 --- a/src/commands/calc/prob.rs +++ b/src/commands/calc/drop.rs @@ -146,9 +146,9 @@ impl Display for TargetRange { } } -/// Probability calculator. +/// Calculate the probability of getting a drop. #[derive(Debug, StructOpt)] -pub struct CalcProbCommand { +pub struct CalcDropCommand { /// The probability of a success. Typically your drop rate. Supports /// decimal, percentage, or fractions. E.g., `0.02`, `2%`, and `1/50` are /// all supported and equivalent. @@ -165,7 +165,7 @@ pub struct CalcProbCommand { target: TargetRange, } -impl Command for CalcProbCommand { +impl Command for CalcDropCommand { fn execute(&self, _context: &CommandContext) -> anyhow::Result<()> { // Valid probability if !(0.0..=1.0).contains(&self.probability) { diff --git a/src/commands/calc/mod.rs b/src/commands/calc/mod.rs index ef7d53b..eee1709 100644 --- a/src/commands/calc/mod.rs +++ b/src/commands/calc/mod.rs @@ -1,12 +1,12 @@ //! This command is a container for additional subcommands related to making //! calculations. -mod prob; +mod drop; mod xp; use crate::{ commands::{ - calc::{prob::CalcProbCommand, xp::CalcXpCommand}, + calc::{drop::CalcDropCommand, xp::CalcXpCommand}, Command, CommandType, }, utils::context::CommandContext, @@ -15,14 +15,14 @@ use structopt::StructOpt; #[derive(Debug, StructOpt)] pub enum CalcCommandType { - Prob(CalcProbCommand), + Drop(CalcDropCommand), Xp(CalcXpCommand), } impl CommandType for CalcCommandType { fn command(&self) -> &dyn Command { match &self { - Self::Prob(cmd) => cmd, + Self::Drop(cmd) => cmd, Self::Xp(cmd) => cmd, } }