Skip to content

Commit

Permalink
Rename calc prob to calc drop
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Oct 11, 2020
1 parent 687726b commit 1a5991c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/commands/calc/prob.rs → src/commands/calc/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/calc/mod.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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,
}
}
Expand Down

0 comments on commit 1a5991c

Please sign in to comment.