From 527f3da75f577cc15f4c4ac07159230cfea6626d Mon Sep 17 00:00:00 2001 From: Joshua Chacksfield Date: Sun, 7 Jul 2024 20:45:05 +0200 Subject: [PATCH] Fixed the lifetimes for the ChartBuilder build_cartesian_(2/3)d --- plotters/src/chart/builder.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plotters/src/chart/builder.rs b/plotters/src/chart/builder.rs index 6d432072..7f087b6c 100644 --- a/plotters/src/chart/builder.rs +++ b/plotters/src/chart/builder.rs @@ -285,12 +285,12 @@ impl<'a, 'b, DB: DrawingBackend> ChartBuilder<'a, 'b, DB> { #[deprecated( note = "`build_ranged` has been renamed to `build_cartesian_2d` and is to be removed in the future." )] - pub fn build_ranged( + pub fn build_ranged<'c, X: AsRangedCoord, Y: AsRangedCoord>( &mut self, x_spec: X, y_spec: Y, ) -> Result< - ChartContext<'a, DB, Cartesian2d>, + ChartContext<'c, DB, Cartesian2d>, DrawingAreaErrorKind, > { self.build_cartesian_2d(x_spec, y_spec) @@ -306,12 +306,12 @@ impl<'a, 'b, DB: DrawingBackend> ChartBuilder<'a, 'b, DB> { See [`ChartBuilder::on()`] and [`ChartContext::configure_mesh()`] for more information and examples. */ #[allow(clippy::type_complexity)] - pub fn build_cartesian_2d( + pub fn build_cartesian_2d<'c, X: AsRangedCoord, Y: AsRangedCoord>( &mut self, x_spec: X, y_spec: Y, ) -> Result< - ChartContext<'a, DB, Cartesian2d>, + ChartContext<'c, DB, Cartesian2d>, DrawingAreaErrorKind, > { let mut label_areas = [None, None, None, None]; @@ -450,13 +450,13 @@ impl<'a, 'b, DB: DrawingBackend> ChartBuilder<'a, 'b, DB> { See [`ChartBuilder::on()`] and [`ChartContext::configure_axes()`] for more information and examples. */ #[allow(clippy::type_complexity)] - pub fn build_cartesian_3d( + pub fn build_cartesian_3d<'c, X: AsRangedCoord, Y: AsRangedCoord, Z: AsRangedCoord>( &mut self, x_spec: X, y_spec: Y, z_spec: Z, ) -> Result< - ChartContext<'a, DB, Cartesian3d>, + ChartContext<'c, DB, Cartesian3d>, DrawingAreaErrorKind, > { let mut drawing_area = DrawingArea::clone(self.root_area);