mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
Janitor: Fix clippy::redundant_clone
This commit is contained in:
parent
f18f333fbb
commit
e8aa79e762
10 changed files with 25 additions and 34 deletions
|
@ -111,7 +111,7 @@ fn create<'cx>(
|
|||
cx: &mut CallContext<'cx, impl neon::object::This>,
|
||||
component_type: sixtyfps_interpreter::ComponentDefinition,
|
||||
) -> JsResult<'cx, JsValue> {
|
||||
let component = component_type.clone().create();
|
||||
let component = component_type.create();
|
||||
let persistent_context = persistent_context::PersistentContext::new(cx);
|
||||
|
||||
if let Some(args) = cx.argument_opt(0).and_then(|arg| arg.downcast::<JsObject>().ok()) {
|
||||
|
@ -385,8 +385,7 @@ declare_types! {
|
|||
.ok_or(())
|
||||
.or_else(|()| {
|
||||
cx.throw_error(format!("Property {} not found in the component", prop_name))
|
||||
})?
|
||||
.clone();
|
||||
})?;
|
||||
|
||||
let persistent_context =
|
||||
persistent_context::PersistentContext::from_object(&mut cx, this.downcast().unwrap())?;
|
||||
|
@ -408,8 +407,7 @@ declare_types! {
|
|||
.ok_or(())
|
||||
.or_else(|()| {
|
||||
cx.throw_error(format!("Callback {} not found in the component", callback_name))
|
||||
})?
|
||||
.clone();
|
||||
})?;
|
||||
let persistent_context =
|
||||
persistent_context::PersistentContext::from_object(&mut cx, this.downcast().unwrap())?;
|
||||
let args = if let Type::Callback {args, ..} = ty {
|
||||
|
@ -449,8 +447,7 @@ declare_types! {
|
|||
.ok_or(())
|
||||
.or_else(|()| {
|
||||
cx.throw_error(format!("Callback {} not found in the component", callback_name))
|
||||
})?
|
||||
.clone();
|
||||
})?;
|
||||
if let Type::Callback {return_type, ..} = ty {
|
||||
component.set_callback(
|
||||
callback_name.as_str(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue