Derive Default implementations wherever possible
This commit is contained in:
parent
f53bee4225
commit
54239c55ae
3 changed files with 10 additions and 21 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
use crate::{Point, Size};
|
use crate::{Point, Size};
|
||||||
|
|
||||||
/// The position of a window in a given screen.
|
/// The position of a window in a given screen.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy, Default)]
|
||||||
pub enum Position {
|
pub enum Position {
|
||||||
/// The platform-specific default position for a new window.
|
/// The platform-specific default position for a new window.
|
||||||
|
#[default]
|
||||||
Default,
|
Default,
|
||||||
/// The window is completely centered on the screen.
|
/// The window is completely centered on the screen.
|
||||||
Centered,
|
Centered,
|
||||||
|
|
@ -22,9 +23,3 @@ pub enum Position {
|
||||||
/// [`Specific`]: Self::Specific
|
/// [`Specific`]: Self::Specific
|
||||||
SpecificWith(fn(Size, Size) -> Point),
|
SpecificWith(fn(Size, Size) -> Point),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Position {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::Default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -882,16 +882,15 @@ mod grid {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub enum Interaction {
|
pub enum Interaction {
|
||||||
|
#[default]
|
||||||
None,
|
None,
|
||||||
Drawing,
|
Drawing,
|
||||||
Erasing,
|
Erasing,
|
||||||
Panning { translation: Vector, start: Point },
|
Panning {
|
||||||
}
|
translation: Vector,
|
||||||
|
start: Point,
|
||||||
impl Default for Interaction {
|
},
|
||||||
fn default() -> Self {
|
|
||||||
Self::None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -285,18 +285,13 @@ struct Task {
|
||||||
state: TaskState,
|
state: TaskState,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone, Default)]
|
||||||
pub enum TaskState {
|
pub enum TaskState {
|
||||||
|
#[default]
|
||||||
Idle,
|
Idle,
|
||||||
Editing,
|
Editing,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TaskState {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::Idle
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum TaskMessage {
|
pub enum TaskMessage {
|
||||||
Completed(bool),
|
Completed(bool),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue