remove some unwrap_unchecked

This commit is contained in:
2025-12-05 20:36:28 -05:00
parent 5480522ddb
commit b08a727fe3
2 changed files with 4 additions and 11 deletions

View File

@@ -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()
}