diff --git a/src/widgets/canvas/line.rs b/src/widgets/canvas/line.rs index cec9f4e7..6e996373 100644 --- a/src/widgets/canvas/line.rs +++ b/src/widgets/canvas/line.rs @@ -66,7 +66,7 @@ impl<'a> Shape<'a> for Line { self.color } - fn points(&'a self) -> Box + 'a> { + fn points(&'a self) -> Box + 'a> { Box::new(self.into_iter()) } } diff --git a/src/widgets/canvas/map.rs b/src/widgets/canvas/map.rs index c80b2ab0..cc16840a 100644 --- a/src/widgets/canvas/map.rs +++ b/src/widgets/canvas/map.rs @@ -37,7 +37,7 @@ impl<'a> Shape<'a> for Map { fn color(&self) -> Color { self.color } - fn points(&'a self) -> Box + 'a> { + fn points(&'a self) -> Box + 'a> { Box::new(self.into_iter()) } } diff --git a/src/widgets/canvas/mod.rs b/src/widgets/canvas/mod.rs index b2a215bd..3688ede1 100644 --- a/src/widgets/canvas/mod.rs +++ b/src/widgets/canvas/mod.rs @@ -28,7 +28,7 @@ pub trait Shape<'a> { /// Returns the color of the shape fn color(&self) -> Color; /// Returns an iterator over all points of the shape - fn points(&'a self) -> Box + 'a>; + fn points(&'a self) -> Box + 'a>; } /// Label to draw some text on the canvas diff --git a/src/widgets/canvas/points.rs b/src/widgets/canvas/points.rs index be17008c..2453e484 100644 --- a/src/widgets/canvas/points.rs +++ b/src/widgets/canvas/points.rs @@ -13,7 +13,7 @@ impl<'a> Shape<'a> for Points<'a> { fn color(&self) -> Color { self.color } - fn points(&'a self) -> Box + 'a> { + fn points(&'a self) -> Box + 'a> { Box::new(self.into_iter()) } } diff --git a/src/widgets/canvas/rectangle.rs b/src/widgets/canvas/rectangle.rs index 91a2e2ba..9408ee4d 100644 --- a/src/widgets/canvas/rectangle.rs +++ b/src/widgets/canvas/rectangle.rs @@ -14,7 +14,7 @@ impl<'a> Shape<'a> for Rectangle { self.color } - fn points(&'a self) -> Box + 'a> { + fn points(&'a self) -> Box + 'a> { let left_line = Line { x1: f64::from(self.rect.x), y1: f64::from(self.rect.y), diff --git a/src/widgets/reflow.rs b/src/widgets/reflow.rs index 32e951a3..4d39a113 100644 --- a/src/widgets/reflow.rs +++ b/src/widgets/reflow.rs @@ -15,7 +15,7 @@ pub trait LineComposer<'a> { /// A state machine that wraps lines on word boundaries. pub struct WordWrapper<'a, 'b> { - symbols: &'b mut Iterator>, + symbols: &'b mut dyn Iterator>, max_line_width: u16, current_line: Vec>, next_line: Vec>, @@ -23,7 +23,7 @@ pub struct WordWrapper<'a, 'b> { impl<'a, 'b> WordWrapper<'a, 'b> { pub fn new( - symbols: &'b mut Iterator>, + symbols: &'b mut dyn Iterator>, max_line_width: u16, ) -> WordWrapper<'a, 'b> { WordWrapper { @@ -121,14 +121,14 @@ impl<'a, 'b> LineComposer<'a> for WordWrapper<'a, 'b> { /// A state machine that truncates overhanging lines. pub struct LineTruncator<'a, 'b> { - symbols: &'b mut Iterator>, + symbols: &'b mut dyn Iterator>, max_line_width: u16, current_line: Vec>, } impl<'a, 'b> LineTruncator<'a, 'b> { pub fn new( - symbols: &'b mut Iterator>, + symbols: &'b mut dyn Iterator>, max_line_width: u16, ) -> LineTruncator<'a, 'b> { LineTruncator {