fn drop(&mut self) {
        let result: Result<(), JsValue> = maybe! {
            let document = web_sys::window().unwrap().document().unwrap();
            let body = document.body().unwrap();
            let mousemove = self.mousemove.as_ref().unchecked_ref();
            body.remove_event_listener_with_callback("mousemove", mousemove)?;

            let mouseup = self.mouseup.as_ref().unchecked_ref();
            body.remove_event_listener_with_callback("mouseup", mouseup)?;

            self.release_cursor()?;
            Ok(())
        };

        result.expect("Drop failed")
    }
/// On `drop`, we must remove these event listeners from the document
/// `body`. Without this, the `Closure` objects would not leak, but the
/// document will continue to call them, causing runtime exceptions.
On `drop`, we must remove these event listeners from the document
`body`. Without this, the `Closure` objects would not leak, but the
document will continue to call them, causing runtime exceptions.
On ` drop ` we must remove these event listeners from the document ` body ` . Without this the ` Closure ` objects would not leak but the document will continue to call them causing runtime exceptions .
fn drop(&mut self) {
        let result: Result<(), JsValue> = maybe! {
            let document = web_sys::window().unwrap().document().unwrap();
            let body = document.body().unwrap();
            let mousemove = self.mousemove.as_ref().unchecked_ref();
            body.remove_event_listener_with_callback("mousemove", mousemove)?;
            let mouseup = self.mouseup.as_ref().unchecked_ref();
            body.remove_event_listener_with_callback("mouseup", mouseup)?;
            self.release_cursor()?;
            Ok(())
        };
        result.expect("Drop failed")
    }
fn drop ( & mut self ) { let result : Result < ( ) , JsValue > = maybe ! { let document web_sys window ( ) unwrap ( ) document ( ) unwrap ( ) let body document body ( ) unwrap ( ) let mousemove self mousemove as_ref ( ) unchecked_ref ( ) body remove_event_listener_with_callback ( " " mousemove ) let mouseup self mouseup as_ref ( ) unchecked_ref ( ) body remove_event_listener_with_callback ( " " mouseup ) self release_cursor ( ) Ok ( ( ) ) } ; result . expect ( " " ) }
On `drop`, we must remove these event listeners from the document
`body`.
On ` drop ` we must remove these event listeners from the document ` body ` .
&mut self
&mut self