simplify some stuff
This commit is contained in:
parent
c20ea511ba
commit
13c694f977
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user