simplify some stuff
This commit is contained in:
parent
c20ea511ba
commit
13c694f977
@ -28,12 +28,7 @@ impl FunctionOutput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn has_integral(&self) -> bool {
|
pub fn has_integral(&self) -> bool { self.front.is_some() }
|
||||||
match &self.front {
|
|
||||||
Some(_) => true,
|
|
||||||
None => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Function {
|
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
|
// Creates and does the math for creating all the rectangles under the graph
|
||||||
fn integral_rectangles(&self) -> (Vec<(f64, f64)>, f64) {
|
fn integral_rectangles(&self) -> (Vec<(f64, f64)>, f64) {
|
||||||
if !self.integral {
|
if !self.integral {
|
||||||
|
|||||||
@ -147,12 +147,7 @@ impl<T> Cache<T> {
|
|||||||
pub fn invalidate(&mut self) { self.backing_data = None; }
|
pub fn invalidate(&mut self) { self.backing_data = None; }
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_valid(&self) -> bool {
|
pub fn is_valid(&self) -> bool { self.backing_data.is_some() }
|
||||||
match &self.backing_data {
|
|
||||||
Some(_) => true,
|
|
||||||
None => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests to make sure my cursed function works as intended
|
// Tests to make sure my cursed function works as intended
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user