simplify some stuff

This commit is contained in:
Simon Gardling 2022-02-26 12:55:29 -05:00
parent c20ea511ba
commit 13c694f977
2 changed files with 2 additions and 16 deletions

View File

@ -28,12 +28,7 @@ impl FunctionOutput {
}
#[inline]
pub fn has_integral(&self) -> bool {
match &self.front {
Some(_) => true,
None => false,
}
}
pub fn has_integral(&self) -> bool { self.front.is_some() }
}
pub struct Function {
@ -209,10 +204,6 @@ impl Function {
}
}
pub fn get_string(&self) -> String { self.func_str.clone() }
pub fn str_compare(&self, other_string: String) -> bool { self.func_str == other_string }
// Creates and does the math for creating all the rectangles under the graph
fn integral_rectangles(&self) -> (Vec<(f64, f64)>, f64) {
if !self.integral {

View File

@ -147,12 +147,7 @@ impl<T> Cache<T> {
pub fn invalidate(&mut self) { self.backing_data = None; }
#[inline]
pub fn is_valid(&self) -> bool {
match &self.backing_data {
Some(_) => true,
None => false,
}
}
pub fn is_valid(&self) -> bool { self.backing_data.is_some() }
}
// Tests to make sure my cursed function works as intended