mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 07:10:04 -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.
|
/// `Default` means bottom for x-axis and left for y-axis.
|
||||||
/// `Opposite` means top for x-axis and right 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 {
|
pub enum Placement {
|
||||||
Default,
|
Default,
|
||||||
Opposite,
|
Opposite,
|
||||||
@@ -75,8 +75,8 @@ impl<const AXIS: usize> Default for AxisHints<AXIS> {
|
|||||||
/// maximum `digits` on tick label is 5
|
/// maximum `digits` on tick label is 5
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let label = match AXIS {
|
let label = match AXIS {
|
||||||
X_AXIS => "x".to_string(),
|
X_AXIS => "x".to_owned(),
|
||||||
Y_AXIS => "y".to_string(),
|
Y_AXIS => "y".to_owned(),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@@ -551,17 +551,17 @@ impl CustomAxisDemo {
|
|||||||
|
|
||||||
let x_axes = vec![
|
let x_axes = vec![
|
||||||
XAxisHints::default()
|
XAxisHints::default()
|
||||||
.label("Time".to_string())
|
.label("Time".to_owned())
|
||||||
.formatter(x_fmt),
|
.formatter(x_fmt),
|
||||||
XAxisHints::default().label("Value".to_string()),
|
XAxisHints::default().label("Value".to_owned()),
|
||||||
];
|
];
|
||||||
let y_axes = vec![
|
let y_axes = vec![
|
||||||
YAxisHints::default()
|
YAxisHints::default()
|
||||||
.label("Percent".to_string())
|
.label("Percent".to_owned())
|
||||||
.formatter(y_fmt)
|
.formatter(y_fmt)
|
||||||
.max_digits(4),
|
.max_digits(4),
|
||||||
YAxisHints::default()
|
YAxisHints::default()
|
||||||
.label("Absolute".to_string())
|
.label("Absolute".to_owned())
|
||||||
.placement(Placement::Opposite),
|
.placement(Placement::Opposite),
|
||||||
];
|
];
|
||||||
Plot::new("custom_axes")
|
Plot::new("custom_axes")
|
||||||
|
|||||||
Reference in New Issue
Block a user