fix FunctionHelper
This commit is contained in:
parent
b681c547b6
commit
ce22f1645f
@ -53,12 +53,11 @@ impl<'a> FunctionHelper<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(threading))]
|
||||||
pub fn new(f: impl Fn(f64, f64) -> f64 + 'a) -> FunctionHelper<'a> {
|
pub fn new(f: impl Fn(f64, f64) -> f64 + 'a) -> FunctionHelper<'a> {
|
||||||
FunctionHelper { f: Box::new(f) }
|
FunctionHelper { f: Box::new(f) }
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub fn get(&self, x: f64, x1: f64) -> f64 { (self.f.lock())(x, x1) }
|
|
||||||
|
|
||||||
#[cfg(threading)]
|
#[cfg(threading)]
|
||||||
pub async fn get(&self, x: f64, x1: f64) -> f64 { (self.f.lock().await)(x, x1) }
|
pub async fn get(&self, x: f64, x1: f64) -> f64 { (self.f.lock().await)(x, x1) }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user