Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
editor: Remove unnecessary clone (#51470)
Finn Eversb77c4441112a
diff --git a/crates/editor/src/hover_popover.rs b/crates/editor/src/hover_popover.rsindex ad54d6105ca..99069cac6ce 100644--- a/crates/editor/src/hover_popover.rs+++ b/crates/editor/src/hover_popover.rs@@ -8,10 +8,10 @@ use crate::{};use anyhow::Context as _;use gpui::{- AnyElement, App, AsyncApp, AsyncWindowContext, Bounds, Context, Entity, Focusable as _,- FontWeight, Hsla, InteractiveElement, IntoElement, MouseButton, ParentElement, Pixels,- ScrollHandle, Size, StatefulInteractiveElement, StyleRefinement, Styled, Subscription, Task,- TextStyleRefinement, WeakEntity, Window, canvas, div, px,+ AnyElement, App, AsyncWindowContext, Bounds, Context, Entity, Focusable as _, FontWeight, Hsla,+ InteractiveElement, IntoElement, MouseButton, ParentElement, Pixels, ScrollHandle, Size,+ StatefulInteractiveElement, StyleRefinement, Styled, Subscription, Task, TextStyleRefinement,+ Window, canvas, div, px,};use itertools::Itertools;use language::{DiagnosticEntry, Language, LanguageRegistry};@@ -73,18 +73,13 @@ pub fn hover_at(}// If we are moving closer, or if no timer is running at all, start/restart the 300ms timer.- let delay = 300u64;- let task = cx.spawn(move |this: WeakEntity<Editor>, cx: &mut AsyncApp| {- let mut cx = cx.clone();- async move {- cx.background_executor()- .timer(Duration::from_millis(delay))- .await;- this.update(&mut cx, |editor, cx| {- hide_hover(editor, cx);- })- .ok();- }+ let delay = Duration::from_millis(300u64);+ let task = cx.spawn(async move |this, cx| {+ cx.background_executor().timer(delay).await;+ this.update(cx, |editor, cx| {+ hide_hover(editor, cx);+ })+ .ok();});editor.hover_state.hiding_delay_task = Some(task);}