mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Merge the Callback and Function type
There is no need for two of these
This simplify some code
Amend efdecf0a13
This commit is contained in:
parent
dff19c52da
commit
6bb0e6038f
15 changed files with 72 additions and 135 deletions
|
@ -27,7 +27,7 @@ pub enum Type {
|
|||
/// The type of a callback alias whose type was not yet inferred
|
||||
InferredCallback,
|
||||
|
||||
Callback(Rc<Callback>),
|
||||
Callback(Rc<Function>),
|
||||
Function(Rc<Function>),
|
||||
|
||||
ComponentFactory,
|
||||
|
@ -127,9 +127,7 @@ impl Display for Type {
|
|||
}
|
||||
write!(f, ")")?
|
||||
}
|
||||
if let Some(rt) = &callback.return_type {
|
||||
write!(f, "-> {}", rt)?;
|
||||
}
|
||||
write!(f, "-> {}", callback.return_type)?;
|
||||
Ok(())
|
||||
}
|
||||
Type::ComponentFactory => write!(f, "component-factory"),
|
||||
|
@ -782,12 +780,6 @@ impl<'a> PropertyLookupResult<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Callback {
|
||||
pub return_type: Option<Type>,
|
||||
pub args: Vec<Type>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Function {
|
||||
pub return_type: Type,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue