Skip to content

Commit

Permalink
Removing PyResults
Browse files Browse the repository at this point in the history
this makes the code more consistent
  • Loading branch information
Vhou-Atroph committed Mar 7, 2024
1 parent fa2ebb1 commit 0cfcda6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/calc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ impl CalculationResults {
}

/// Builds the calculation history string
pub fn build(&self) -> PyResult<String> {
Ok(format!(
pub fn build(&self) -> String {
format!(
"--------\nDamage this round:{}\nWill kill: Level {} cogs\nLured: {}\n{}\n",
self.dmg, self.lvl, self.lured, self.give_defense()))
self.dmg, self.lvl, self.lured, self.give_defense())
}

/// Matches the defense values to create a string to reflect the most recent battle's calculations in calculation history.
Expand Down
6 changes: 3 additions & 3 deletions src/gags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ impl Gag {
}

/// Returns the damage an organic gag of a certain type does.
pub fn button_press(&self,org_val:bool) -> PyResult<(i64,String)> { // (damage,name)
if self.gtype == "Gag" && org_val {return Ok((self.org().expect("An error happened!"),format!("Organic {}",self.name)))}
Ok((self.dmg,self.name.clone()))
pub fn button_press(&self,org_val:bool) -> (i64,String) { // (damage,name)
if self.gtype == "Gag" && org_val {return (self.org().expect("An error happened!"),format!("Organic {}",self.name))}
(self.dmg,self.name.clone())
}

/// Returns the amount of damage a gag will do when organic.
Expand Down

0 comments on commit 0cfcda6

Please sign in to comment.