From 74813f5f135cf4c0b05cd22d8a10cf1820297fcc Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 3 Dec 2025 16:25:27 -0500 Subject: [PATCH] misc: use lifetimes for EguiHelper --- src/misc.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/misc.rs b/src/misc.rs index 2d3db5d..9ed1e93 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -1,4 +1,4 @@ -use base64::{Engine as _, engine::general_purpose}; +use base64::{engine::general_purpose, Engine as _}; use egui_plot::{Line, PlotPoint, PlotPoints, Points}; use emath::Pos2; use getrandom::getrandom; @@ -8,13 +8,13 @@ use parsing::FlatExWrapper; /// Implements traits that are useful when dealing with Vectors of egui's `Value` pub trait EguiHelper { /// Converts to `egui::plot::Values` - fn to_values(self) -> PlotPoints; + fn to_values(self) -> PlotPoints<'static>; /// Converts to `egui::plot::Line` - fn to_line(self) -> Line; + fn to_line(self) -> Line<'static>; /// Converts to `egui::plot::Points` - fn to_points(self) -> Points; + fn to_points(self) -> Points<'static>; /// Converts Vector of Values into vector of tuples fn to_tuple(self) -> Vec<(f64, f64)>; @@ -22,18 +22,18 @@ pub trait EguiHelper { impl EguiHelper for Vec { #[inline(always)] - fn to_values(self) -> PlotPoints { + fn to_values(self) -> PlotPoints<'static> { PlotPoints::from(unsafe { std::mem::transmute::, Vec<[f64; 2]>>(self) }) } #[inline(always)] - fn to_line(self) -> Line { - Line::new(self.to_values()) + fn to_line(self) -> Line<'static> { + Line::new("", self.to_values()) } #[inline(always)] - fn to_points(self) -> Points { - Points::new(self.to_values()) + fn to_points(self) -> Points<'static> { + Points::new("", self.to_values()) } #[inline(always)]