fix clippy issues

This commit is contained in:
2024-12-11 09:11:30 +07:00
parent 516eb0e8bc
commit 10f042acab
49 changed files with 661 additions and 319 deletions

View File

@@ -12,11 +12,13 @@ pub struct Breadcrumb {
items: Vec<BreadcrumbItem>,
}
type OnClick = Option<Rc<dyn Fn(&ClickEvent, &mut WindowContext)>>;
#[derive(IntoElement)]
pub struct BreadcrumbItem {
id: ElementId,
text: SharedString,
on_click: Option<Rc<dyn Fn(&ClickEvent, &mut WindowContext)>>,
on_click: OnClick,
disabled: bool,
is_last: bool,
}
@@ -46,6 +48,7 @@ impl BreadcrumbItem {
}
/// For internal use only.
#[allow(clippy::wrong_self_convention)]
fn is_last(mut self, is_last: bool) -> Self {
self.is_last = is_last;
self
@@ -84,6 +87,12 @@ impl Breadcrumb {
}
}
impl Default for Breadcrumb {
fn default() -> Self {
Self::new()
}
}
#[derive(IntoElement)]
struct BreadcrumbSeparator;
impl RenderOnce for BreadcrumbSeparator {