Skip to content

Commit 5904296

Browse files
authored
Replace impl Into<f32> parameters with just f32 (#249)
1 parent 434b294 commit 5904296

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

egui_plot/src/items/line.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ impl HLine {
4545

4646
/// Stroke width. A high value means the plot thickens.
4747
#[inline]
48-
pub fn width(mut self, width: impl Into<f32>) -> Self {
49-
self.stroke.width = width.into();
48+
pub fn width(mut self, width: f32) -> Self {
49+
self.stroke.width = width;
5050
self
5151
}
5252

@@ -180,8 +180,8 @@ impl VLine {
180180

181181
/// Stroke width. A high value means the plot thickens.
182182
#[inline]
183-
pub fn width(mut self, width: impl Into<f32>) -> Self {
184-
self.stroke.width = width.into();
183+
pub fn width(mut self, width: f32) -> Self {
184+
self.stroke.width = width;
185185
self
186186
}
187187

egui_plot/src/items/points.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ impl<'a> Points<'a> {
5656
/// Whether to add stems between the markers and a horizontal reference
5757
/// line.
5858
#[inline]
59-
pub fn stems(mut self, y_reference: impl Into<f32>) -> Self {
60-
self.stems = Some(y_reference.into());
59+
pub fn stems(mut self, y_reference: f32) -> Self {
60+
self.stems = Some(y_reference);
6161
self
6262
}
6363

6464
/// Set the maximum extent of the marker around its position, in ui points.
6565
#[inline]
66-
pub fn radius(mut self, radius: impl Into<f32>) -> Self {
67-
self.radius = radius.into();
66+
pub fn radius(mut self, radius: f32) -> Self {
67+
self.radius = radius;
6868
self
6969
}
7070

egui_plot/src/items/polygon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ impl<'a> Polygon<'a> {
4545

4646
/// Set the stroke width.
4747
#[inline]
48-
pub fn width(mut self, width: impl Into<f32>) -> Self {
49-
self.stroke.width = width.into();
48+
pub fn width(mut self, width: f32) -> Self {
49+
self.stroke.width = width;
5050
self
5151
}
5252

egui_plot/src/items/series.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl<'a> Line<'a> {
8181

8282
/// Stroke width. A high value means the plot thickens.
8383
#[inline]
84-
pub fn width(mut self, width: impl Into<f32>) -> Self {
85-
self.stroke.width = width.into();
84+
pub fn width(mut self, width: f32) -> Self {
85+
self.stroke.width = width;
8686
self
8787
}
8888

@@ -96,15 +96,15 @@ impl<'a> Line<'a> {
9696

9797
/// Fill the area between this line and a given horizontal reference line.
9898
#[inline]
99-
pub fn fill(mut self, y_reference: impl Into<f32>) -> Self {
100-
self.fill = Some(y_reference.into());
99+
pub fn fill(mut self, y_reference: f32) -> Self {
100+
self.fill = Some(y_reference);
101101
self
102102
}
103103

104104
/// Set the fill area's alpha channel. Default is `0.05`.
105105
#[inline]
106-
pub fn fill_alpha(mut self, alpha: impl Into<f32>) -> Self {
107-
self.fill_alpha = alpha.into();
106+
pub fn fill_alpha(mut self, alpha: f32) -> Self {
107+
self.fill_alpha = alpha;
108108
self
109109
}
110110

egui_plot/src/items/span.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ impl Span {
9696

9797
/// Convenience for updating the span border width.
9898
#[inline]
99-
pub fn border_width(mut self, width: impl Into<f32>) -> Self {
100-
self.border_stroke.width = width.into();
99+
pub fn border_width(mut self, width: f32) -> Self {
100+
self.border_stroke.width = width;
101101
self
102102
}
103103

0 commit comments

Comments
 (0)