Skip to content

Commit

Permalink
Fix clippy warnings and fix CI to fail when have warnings. (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee authored Oct 3, 2024
1 parent ce10a03 commit 19bb5ee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
target/
key: ubuntu-test-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Lint
run: cargo clippy
run: cargo clippy -- --deny warnings
- name: Build test
run: cargo build
9 changes: 4 additions & 5 deletions crates/story/src/table_story.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use std::time::{self, Duration};

use fake::{Fake, Faker};
use gpui::{
div, impl_actions, AnyElement, ClickEvent, InteractiveElement, IntoElement, ParentElement,
Pixels, Render, SharedString, Styled, Timer, View, ViewContext, VisualContext as _,
WindowContext,
div, impl_actions, AnyElement, InteractiveElement, IntoElement, ParentElement, Pixels, Render,
SharedString, Styled, Timer, View, ViewContext, VisualContext as _, WindowContext,
};
use serde::Deserialize;
use ui::{
Expand All @@ -17,7 +16,7 @@ use ui::{
popup_menu::PopupMenuExt,
prelude::FluentBuilder as _,
table::{ColFixed, ColSort, Table, TableDelegate, TableEvent},
v_flex, Selectable, Sizable, Size,
v_flex, Selectable, Size,
};

#[derive(Clone, PartialEq, Eq, Deserialize)]
Expand Down Expand Up @@ -662,7 +661,7 @@ impl Render for TableStory {
.compact()
.outline()
.label(format!("size: {:?}", self.size))
.popup_menu(move |menu, cx| {
.popup_menu(move |menu, _| {
menu.menu_with_check(
"Large",
size == Size::Large,
Expand Down
6 changes: 3 additions & 3 deletions crates/ui/src/dock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,17 +265,17 @@ impl DockArea {
DockPlacement::Left => self
.left_dock
.as_ref()
.and_then(|dock| Some(dock.read(cx).is_open()))
.map(|dock| dock.read(cx).is_open())
.unwrap_or(false),
DockPlacement::Bottom => self
.bottom_dock
.as_ref()
.and_then(|dock| Some(dock.read(cx).is_open()))
.map(|dock| dock.read(cx).is_open())
.unwrap_or(false),
DockPlacement::Right => self
.right_dock
.as_ref()
.and_then(|dock| Some(dock.read(cx).is_open()))
.map(|dock| dock.read(cx).is_open())
.unwrap_or(false),
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ui/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ where
fn set_selected_col(&mut self, col_ix: usize, cx: &mut ViewContext<Self>) {
self.selection_state = SelectionState::Column;
self.selected_col = Some(col_ix);
if let Some(col_ix) = self.selected_col {
if let Some(_col_ix) = self.selected_col {
// TODO: Fix scroll to selected col, this was not working after fixed col.
// if self.col_groups[col_ix].fixed.is_none() {
// self.horizontal_scroll_handle.scroll_to_item(col_ix);
Expand Down

0 comments on commit 19bb5ee

Please sign in to comment.