fix: clippy issues

This commit is contained in:
2025-02-01 15:32:53 +07:00
parent 09a0d089bc
commit c982c802e2
10 changed files with 205 additions and 67 deletions

View File

@@ -1,18 +1,22 @@
use crate::{
button::{Button, ButtonVariants as _},
h_flex, IconName, Sizable as _,
};
use gpui::{
prelude::FluentBuilder, AnyElement, App, ClipboardItem, Element, ElementId, GlobalElementId,
IntoElement, LayoutId, ParentElement, SharedString, Styled, Window,
};
use std::{cell::RefCell, rc::Rc, time::Duration};
use crate::{
button::{Button, ButtonVariants as _},
h_flex, IconName, Sizable as _,
};
type ContentBuilder = Option<Box<dyn Fn(&mut Window, &mut App) -> AnyElement>>;
type CopiedCallback = Option<Rc<dyn Fn(SharedString, &mut Window, &mut App)>>;
pub struct Clipboard {
id: ElementId,
value: SharedString,
content_builder: Option<Box<dyn Fn(&mut Window, &mut App) -> AnyElement>>,
copied_callback: Option<Rc<dyn Fn(SharedString, &mut Window, &mut App)>>,
content_builder: ContentBuilder,
copied_callback: CopiedCallback,
}
impl Clipboard {