Janitor: Fix clippy::map_clone

This commit is contained in:
Tobias Hunger 2021-08-04 22:02:54 +02:00 committed by Olivier Goffart
parent 0d73917526
commit 04738a900f
3 changed files with 4 additions and 4 deletions

View file

@ -483,7 +483,7 @@ declare_types! {
method show(mut cx) {
let this = cx.this();
let window = cx.borrow(&this, |x| x.0.as_ref().map(|c| c.clone()));
let window = cx.borrow(&this, |x| x.0.as_ref().cloned());
let window = window.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?;
window.show();
Ok(JsUndefined::new().as_value(&mut cx))
@ -491,7 +491,7 @@ declare_types! {
method hide(mut cx) {
let this = cx.this();
let window = cx.borrow(&this, |x| x.0.as_ref().map(|c| c.clone()));
let window = cx.borrow(&this, |x| x.0.as_ref().cloned());
let window = window.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?;
window.hide();
Ok(JsUndefined::new().as_value(&mut cx))