mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
janitor: use the new default attribute for enums
This commit is contained in:
parent
7e77a2a4cc
commit
7122d22c88
10 changed files with 28 additions and 97 deletions
|
@ -325,9 +325,10 @@ impl Default for Unit {
|
|||
}
|
||||
|
||||
/// The Expression is hold by properties, so it should not hold any strong references to node from the object_tree
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub enum Expression {
|
||||
/// Something went wrong (and an error will be reported)
|
||||
#[default]
|
||||
Invalid,
|
||||
/// We haven't done the lookup yet
|
||||
Uncompiled(SyntaxNode),
|
||||
|
@ -504,12 +505,6 @@ pub enum Expression {
|
|||
SolveLayout(crate::layout::Layout, crate::layout::Orientation),
|
||||
}
|
||||
|
||||
impl Default for Expression {
|
||||
fn default() -> Self {
|
||||
Expression::Invalid
|
||||
}
|
||||
}
|
||||
|
||||
impl Expression {
|
||||
/// Return the type of this property
|
||||
pub fn ty(&self) -> Type {
|
||||
|
@ -1342,20 +1337,15 @@ pub struct PathElement {
|
|||
pub bindings: BindingsMap,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub enum EasingCurve {
|
||||
#[default]
|
||||
Linear,
|
||||
CubicBezier(f32, f32, f32, f32),
|
||||
// CubicBezierNonConst([Box<Expression>; 4]),
|
||||
// Custom(Box<dyn Fn(f32)->f32>),
|
||||
}
|
||||
|
||||
impl Default for EasingCurve {
|
||||
fn default() -> Self {
|
||||
Self::Linear
|
||||
}
|
||||
}
|
||||
|
||||
// The compiler generates ResourceReference::AbsolutePath for all references like @image-url("foo.png")
|
||||
// and the resource lowering path may change this to EmbeddedData if configured.
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue