remove some unwrap_unchecked
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use base64::Engine;
|
||||
use base64::engine::general_purpose;
|
||||
use base64::Engine;
|
||||
use egui_plot::{Line, PlotPoint, PlotPoints, Points};
|
||||
use emath::Pos2;
|
||||
use itertools::Itertools;
|
||||
@@ -91,9 +91,7 @@ pub fn newtons_method_helper(
|
||||
.filter(|(prev, curr)| prev.y.is_finite() && curr.y.is_finite())
|
||||
.filter(|(prev, curr)| prev.y.signum() != curr.y.signum())
|
||||
.map(|(start, _)| start.x)
|
||||
.map(|x| newtons_method(f, f_1, x, range, threshold))
|
||||
.filter(|x| x.is_some())
|
||||
.map(|x| unsafe { x.unwrap_unchecked() })
|
||||
.filter_map(|x| newtons_method(f, f_1, x, range, threshold))
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user