mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 21:00:03 -04:00
plot: Resolve check.sh warnings
This commit is contained in:
@@ -23,7 +23,7 @@ pub(super) const Y_AXIS: usize = 1;
|
||||
///
|
||||
/// `Default` means bottom for x-axis and left for y-axis.
|
||||
/// `Opposite` means top for x-axis and right for y-axis.
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Placement {
|
||||
Default,
|
||||
Opposite,
|
||||
@@ -75,8 +75,8 @@ impl<const AXIS: usize> Default for AxisHints<AXIS> {
|
||||
/// maximum `digits` on tick label is 5
|
||||
fn default() -> Self {
|
||||
let label = match AXIS {
|
||||
X_AXIS => "x".to_string(),
|
||||
Y_AXIS => "y".to_string(),
|
||||
X_AXIS => "x".to_owned(),
|
||||
Y_AXIS => "y".to_owned(),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
Self {
|
||||
|
||||
@@ -551,17 +551,17 @@ impl CustomAxisDemo {
|
||||
|
||||
let x_axes = vec![
|
||||
XAxisHints::default()
|
||||
.label("Time".to_string())
|
||||
.label("Time".to_owned())
|
||||
.formatter(x_fmt),
|
||||
XAxisHints::default().label("Value".to_string()),
|
||||
XAxisHints::default().label("Value".to_owned()),
|
||||
];
|
||||
let y_axes = vec![
|
||||
YAxisHints::default()
|
||||
.label("Percent".to_string())
|
||||
.label("Percent".to_owned())
|
||||
.formatter(y_fmt)
|
||||
.max_digits(4),
|
||||
YAxisHints::default()
|
||||
.label("Absolute".to_string())
|
||||
.label("Absolute".to_owned())
|
||||
.placement(Placement::Opposite),
|
||||
];
|
||||
Plot::new("custom_axes")
|
||||
|
||||
Reference in New Issue
Block a user