Skip to content

Commit 2ac412c

Browse files
committed
minor clippy polishing
1 parent 208b4a1 commit 2ac412c

6 files changed

Lines changed: 38 additions & 37 deletions

File tree

src/app.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,47 +1232,48 @@ impl CurveFitApp {
12321232
visuals.faint_bg_color = egui::Color32::from_rgb(24, 30, 38);
12331233
visuals.extreme_bg_color = egui::Color32::from_rgb(8, 11, 16);
12341234
visuals.code_bg_color = egui::Color32::from_rgb(10, 20, 28);
1235-
visuals.window_stroke = egui::Stroke::new(1.0, egui::Color32::from_rgb(52, 70, 85));
1235+
visuals.window_stroke =
1236+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(52, 70, 85));
12361237
visuals.selection.bg_fill = egui::Color32::from_rgb(22, 88, 120);
12371238
visuals.selection.stroke =
1238-
egui::Stroke::new(1.0, egui::Color32::from_rgb(152, 226, 255));
1239+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(152, 226, 255));
12391240
visuals.hyperlink_color = egui::Color32::from_rgb(94, 204, 255);
12401241
visuals.widgets.inactive.weak_bg_fill = egui::Color32::from_rgb(28, 35, 44);
12411242
visuals.widgets.inactive.bg_stroke =
1242-
egui::Stroke::new(1.0, egui::Color32::from_rgb(52, 70, 85));
1243+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(52, 70, 85));
12431244
visuals.widgets.hovered.weak_bg_fill = egui::Color32::from_rgb(34, 49, 61);
12441245
visuals.widgets.hovered.bg_stroke =
1245-
egui::Stroke::new(1.0, egui::Color32::from_rgb(70, 113, 138));
1246+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(70, 113, 138));
12461247
visuals.widgets.active.weak_bg_fill = egui::Color32::from_rgb(27, 84, 108);
12471248
visuals.widgets.active.bg_stroke =
1248-
egui::Stroke::new(1.0, egui::Color32::from_rgb(86, 171, 211));
1249+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(86, 171, 211));
12491250
visuals.widgets.open.weak_bg_fill = egui::Color32::from_rgb(33, 57, 73);
12501251
visuals.widgets.open.bg_stroke =
1251-
egui::Stroke::new(1.0, egui::Color32::from_rgb(72, 122, 150));
1252+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(72, 122, 150));
12521253
} else {
12531254
visuals.panel_fill = egui::Color32::from_rgb(239, 245, 249);
12541255
visuals.window_fill = egui::Color32::from_rgb(246, 250, 252);
12551256
visuals.faint_bg_color = egui::Color32::from_rgb(225, 236, 242);
12561257
visuals.extreme_bg_color = egui::Color32::from_rgb(251, 253, 255);
12571258
visuals.code_bg_color = egui::Color32::from_rgb(235, 245, 250);
12581259
visuals.window_stroke =
1259-
egui::Stroke::new(1.0, egui::Color32::from_rgb(165, 188, 201));
1260+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(165, 188, 201));
12601261
visuals.selection.bg_fill = egui::Color32::from_rgb(150, 214, 235);
12611262
visuals.selection.stroke =
1262-
egui::Stroke::new(1.0, egui::Color32::from_rgb(20, 76, 96));
1263+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(20, 76, 96));
12631264
visuals.hyperlink_color = egui::Color32::from_rgb(0, 118, 163);
12641265
visuals.widgets.inactive.weak_bg_fill = egui::Color32::from_rgb(220, 234, 241);
12651266
visuals.widgets.inactive.bg_stroke =
1266-
egui::Stroke::new(1.0, egui::Color32::from_rgb(163, 189, 203));
1267+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(163, 189, 203));
12671268
visuals.widgets.hovered.weak_bg_fill = egui::Color32::from_rgb(208, 227, 237);
12681269
visuals.widgets.hovered.bg_stroke =
1269-
egui::Stroke::new(1.0, egui::Color32::from_rgb(128, 170, 192));
1270+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(128, 170, 192));
12701271
visuals.widgets.active.weak_bg_fill = egui::Color32::from_rgb(183, 220, 236);
12711272
visuals.widgets.active.bg_stroke =
1272-
egui::Stroke::new(1.0, egui::Color32::from_rgb(87, 151, 182));
1273+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(87, 151, 182));
12731274
visuals.widgets.open.weak_bg_fill = egui::Color32::from_rgb(198, 224, 236);
12741275
visuals.widgets.open.bg_stroke =
1275-
egui::Stroke::new(1.0, egui::Color32::from_rgb(103, 160, 188));
1276+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(103, 160, 188));
12761277
}
12771278
});
12781279
}
@@ -1285,7 +1286,7 @@ impl CurveFitApp {
12851286
))
12861287
.fill(style.visuals.panel_fill)
12871288
.stroke(egui::Stroke::new(
1288-
1.0,
1289+
1.0_f32,
12891290
style.visuals.widgets.noninteractive.bg_stroke.color,
12901291
))
12911292
}
@@ -1295,7 +1296,7 @@ impl CurveFitApp {
12951296
.inner_margin(egui::Margin::symmetric(PANEL_INNER_MARGIN_X, 6))
12961297
.fill(style.visuals.panel_fill)
12971298
.stroke(egui::Stroke::new(
1298-
1.0,
1299+
1.0_f32,
12991300
style.visuals.widgets.noninteractive.bg_stroke.color,
13001301
))
13011302
}

src/app/ui.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl CurveFitApp {
4242
.corner_radius(egui::CornerRadius::same(PANEL_CARD_CORNER_RADIUS))
4343
.fill(ui.visuals().faint_bg_color)
4444
.stroke(egui::Stroke::new(
45-
1.0,
45+
1.0_f32,
4646
ui.visuals().widgets.noninteractive.bg_stroke.color,
4747
))
4848
}
@@ -135,26 +135,26 @@ impl CurveFitApp {
135135
if ui.visuals().dark_mode {
136136
(
137137
egui::Color32::from_rgb(120, 58, 49),
138-
egui::Stroke::new(1.0, egui::Color32::from_rgb(199, 99, 82)),
138+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(199, 99, 82)),
139139
egui::Color32::from_rgb(255, 238, 232),
140140
)
141141
} else {
142142
(
143143
egui::Color32::from_rgb(235, 208, 198),
144-
egui::Stroke::new(1.0, egui::Color32::from_rgb(194, 106, 85)),
144+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(194, 106, 85)),
145145
egui::Color32::from_rgb(94, 37, 23),
146146
)
147147
}
148148
} else if ui.visuals().dark_mode {
149149
(
150150
egui::Color32::from_rgb(20, 94, 128),
151-
egui::Stroke::new(1.0, egui::Color32::from_rgb(98, 199, 232)),
151+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(98, 199, 232)),
152152
egui::Color32::from_rgb(227, 247, 255),
153153
)
154154
} else {
155155
(
156156
egui::Color32::from_rgb(182, 224, 241),
157-
egui::Stroke::new(1.0, egui::Color32::from_rgb(68, 146, 178)),
157+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(68, 146, 178)),
158158
egui::Color32::from_rgb(13, 67, 86),
159159
)
160160
}

src/app/ui/diagnostics_panel.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,26 +134,26 @@ fn ui_loss_diagnostics(
134134
PlotPoints::from_iter(loss_points.iter().copied()),
135135
)
136136
.id(egui::Id::new(DIAGNOSTICS_SERIES_ID_LOSS))
137-
.width(1.9)
137+
.width(1.9_f32)
138138
.color(loss_color),
139139
);
140140
if app.fit_loss_metric != OptimizationLossMetric::Mse {
141141
plot_ui.line(
142142
Line::new("MSE", PlotPoints::from_iter(mse_points.iter().copied()))
143143
.id(egui::Id::new(DIAGNOSTICS_SERIES_ID_MSE))
144-
.width(1.5),
144+
.width(1.5_f32),
145145
);
146146
}
147147
plot_ui.line(
148148
Line::new("RMSE", PlotPoints::from_iter(rmse_points.iter().copied()))
149149
.id(egui::Id::new(DIAGNOSTICS_SERIES_ID_RMSE))
150-
.width(1.5),
150+
.width(1.5_f32),
151151
);
152152
if app.fit_loss_metric != OptimizationLossMetric::Mae {
153153
plot_ui.line(
154154
Line::new("MAE", PlotPoints::from_iter(mae_points.iter().copied()))
155155
.id(egui::Id::new(DIAGNOSTICS_SERIES_ID_MAE))
156-
.width(1.5),
156+
.width(1.5_f32),
157157
);
158158
}
159159
if app.fit_loss_metric != OptimizationLossMetric::SoftL1 {
@@ -163,29 +163,29 @@ fn ui_loss_diagnostics(
163163
PlotPoints::from_iter(soft_l1_points.iter().copied()),
164164
)
165165
.id(egui::Id::new(DIAGNOSTICS_SERIES_ID_SOFT_L1))
166-
.width(1.5),
166+
.width(1.5_f32),
167167
);
168168
}
169169
plot_ui.line(
170170
Line::new("|R2|", PlotPoints::from_iter(r2_abs_points.iter().copied()))
171171
.id(egui::Id::new(DIAGNOSTICS_SERIES_ID_R2_ABS))
172-
.width(1.5),
172+
.width(1.5_f32),
173173
);
174174
plot_ui.line(
175175
Line::new(
176176
"MaxAbsError",
177177
PlotPoints::from_iter(max_abs_error_points.iter().copied()),
178178
)
179179
.id(egui::Id::new(DIAGNOSTICS_SERIES_ID_MAX_ABS))
180-
.width(1.5),
180+
.width(1.5_f32),
181181
);
182182
if let Some(selected_iteration_x) = selected_iteration_x {
183183
plot_ui.vline(
184184
VLine::new("", selected_iteration_x)
185185
.id(egui::Id::new(
186186
DIAGNOSTICS_SELECTED_ITERATION_MARKER_ID_LOSS,
187187
))
188-
.width(1.0)
188+
.width(1.0_f32)
189189
.color(selected_iteration_marker_color)
190190
.style(LineStyle::dashed_dense())
191191
.allow_hover(false),
@@ -228,7 +228,7 @@ fn ui_loss_diagnostics(
228228
name.clone(),
229229
PlotPoints::from_iter(series.iter().copied()),
230230
)
231-
.width(1.7),
231+
.width(1.7_f32),
232232
);
233233
}
234234
if let Some(selected_iteration_x) = selected_iteration_x {
@@ -237,7 +237,7 @@ fn ui_loss_diagnostics(
237237
.id(egui::Id::new(
238238
DIAGNOSTICS_SELECTED_ITERATION_MARKER_ID_PARAMS,
239239
))
240-
.width(1.0)
240+
.width(1.0_f32)
241241
.color(selected_iteration_marker_color)
242242
.style(LineStyle::dashed_dense())
243243
.allow_hover(false),
@@ -305,15 +305,15 @@ fn ui_residuals_diagnostics(
305305
tr(language, "Zero", "Ноль"),
306306
PlotPoints::from_iter(zero_line),
307307
)
308-
.width(1.2)
308+
.width(1.2_f32)
309309
.color(zero_color),
310310
);
311311
plot_ui.points(
312312
PlotPointsItem::new(
313313
tr(language, "Residuals", "Остатки"),
314314
residual_points.as_slice(),
315315
)
316-
.radius(2.3)
316+
.radius(2.3_f32)
317317
.color(residual_color),
318318
);
319319
});

src/app/ui/family_params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub(super) fn ui_family_and_params(app: &mut CurveFitApp, ui: &mut egui::Ui) {
6161
.corner_radius(egui::CornerRadius::same(PANEL_CARD_CORNER_RADIUS))
6262
.fill(ui.visuals().extreme_bg_color)
6363
.stroke(egui::Stroke::new(
64-
1.0,
64+
1.0_f32,
6565
ui.visuals().widgets.noninteractive.bg_stroke.color,
6666
))
6767
.show(ui, |ui| {

src/app/ui/plot_panel.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,20 +297,20 @@ pub(super) fn ui_plot(app: &mut CurveFitApp, ui: &mut egui::Ui, height: f32) {
297297
if !points_slice.is_empty() {
298298
plot_ui.points(
299299
PlotPointsItem::new(tr(language, "Samples", "Точки"), points_slice)
300-
.radius(2.8)
300+
.radius(2.8_f32)
301301
.color(samples_color),
302302
);
303303
}
304304
if let Some(fitted) = spline_curve_slice {
305305
plot_ui.line(
306306
Line::new(fitted_line_name.clone(), fitted)
307-
.width(2.2)
307+
.width(2.2_f32)
308308
.color(fitted_color),
309309
);
310310
} else if let Some(fitted) = sampled_curve.as_deref() {
311311
plot_ui.line(
312312
Line::new(fitted_line_name.clone(), fitted)
313-
.width(2.2)
313+
.width(2.2_f32)
314314
.color(fitted_color),
315315
);
316316
}

src/app/ui/points_editor_panel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,11 @@ fn with_toolbar_hover_style(ui: &mut egui::Ui, add_contents: impl FnOnce(&mut eg
412412
if dark_mode {
413413
widgets.hovered.weak_bg_fill = egui::Color32::from_rgb(44, 64, 79);
414414
widgets.hovered.bg_stroke =
415-
egui::Stroke::new(1.0, egui::Color32::from_rgb(96, 148, 177));
415+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(96, 148, 177));
416416
} else {
417417
widgets.hovered.weak_bg_fill = egui::Color32::from_rgb(196, 220, 232);
418418
widgets.hovered.bg_stroke =
419-
egui::Stroke::new(1.0, egui::Color32::from_rgb(105, 160, 186));
419+
egui::Stroke::new(1.0_f32, egui::Color32::from_rgb(105, 160, 186));
420420
}
421421
add_contents(ui);
422422
});

0 commit comments

Comments
 (0)