diff --git a/src/function.rs b/src/function.rs index cded261..2bb435a 100644 --- a/src/function.rs +++ b/src/function.rs @@ -140,14 +140,14 @@ impl FunctionEntry { 0 => newtons_method_helper( &threshold, &range, - &self.output.back.to_owned().unwrap(), + &self.output.back.as_ref().unwrap(), &|x: f64| self.function.get(x), &|x: f64| self.function.get_derivative_1(x), ), 1 => newtons_method_helper( &threshold, &range, - &self.output.derivative.to_owned().unwrap(), + &self.output.derivative.as_ref().unwrap(), &|x: f64| self.function.get_derivative_1(x), &|x: f64| self.function.get_derivative_2(x), ),