Fix clippy warning

This commit is contained in:
Floyd Wang 2024-07-15 11:42:14 +08:00
parent 59603ab83b
commit b1bb22fd1d
3 changed files with 273 additions and 527 deletions

788
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -72,12 +72,10 @@ impl RenderOnce for CompanyListItem {
let bg_color = if self.selected { let bg_color = if self.selected {
cx.theme().accent cx.theme().accent
} else if self.ix % 2 == 0 {
cx.theme().background
} else { } else {
if self.ix % 2 == 0 { cx.theme().accent.opacity(0.3)
cx.theme().background
} else {
cx.theme().accent.opacity(0.3)
}
}; };
self.base self.base
@ -180,7 +178,7 @@ pub struct ListStory {
impl ListStory { impl ListStory {
pub fn view(cx: &mut WindowContext) -> View<Self> { pub fn view(cx: &mut WindowContext) -> View<Self> {
cx.new_view(|cx| Self::new(cx)) cx.new_view(Self::new)
} }
fn new(cx: &mut ViewContext<Self>) -> Self { fn new(cx: &mut ViewContext<Self>) -> Self {

View file

@ -321,7 +321,7 @@ where
let layout_id = element.request_layout(cx); let layout_id = element.request_layout(cx);
( (
( (
layout_id.clone(), layout_id,
DropdownMenuElementState { DropdownMenuElementState {
layout_id: Some(layout_id), layout_id: Some(layout_id),
menu_element: Some(element), menu_element: Some(element),