Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: fix warnings

appflowy6e71d6d32514
diff --git a/frontend/app_flowy/lib/plugins/board/presentation/board_page.dart b/frontend/app_flowy/lib/plugins/board/presentation/board_page.dart
index 608d4582be..e850186f89 100644
--- a/frontend/app_flowy/lib/plugins/board/presentation/board_page.dart
+++ b/frontend/app_flowy/lib/plugins/board/presentation/board_page.dart
@@ -112,7 +112,7 @@ class _BoardContentState extends State<BoardContent> {
column,
columnItem,
),
- columnConstraints: const BoxConstraints.tightFor(width: 240),
+ columnConstraints: const BoxConstraints.tightFor(width: 300),
config: AFBoardConfig(
columnBackgroundColor: HexColor.fromHex('#F7F8FC'),
),
diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart
index 0e0a7287ae..3ca934e508 100644
--- a/frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart
+++ b/frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart
@@ -93,14 +93,15 @@ BoxDecoration _makeBoxDecoration(BuildContext context) {
final theme = context.read<AppTheme>();
final borderSide = BorderSide(color: theme.shader6, width: 1.0);
return BoxDecoration(
- color: theme.surface,
+ color: Colors.transparent,
border: Border.fromBorderSide(borderSide),
- boxShadow: [
+ boxShadow: const [
BoxShadow(
- color: theme.shader6,
- spreadRadius: 0,
- blurRadius: 2,
- offset: Offset.zero)
+ color: Colors.transparent,
+ spreadRadius: 0,
+ blurRadius: 2,
+ offset: Offset.zero,
+ )
],
borderRadius: const BorderRadius.all(Radius.circular(6)),
);
@@ -120,8 +121,9 @@ class _CardEnterRegion extends StatelessWidget {
builder: (context, onEnter, _) {
List<Widget> children = [child];
if (onEnter) {
- children.add(CardAccessoryContainer(accessories: accessories)
- .positioned(right: 0));
+ children.add(CardAccessoryContainer(
+ accessories: accessories,
+ ).positioned(right: 0));
}
return MouseRegion(
diff --git a/frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rs b/frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rs
index 8c9893e4ef..70e4cc29b1 100644
--- a/frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rs
+++ b/frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rs
@@ -142,7 +142,7 @@ impl GridViewManager {
.move_group_row(&row_rev, &mut row_changeset, &to_group_id, to_row_id.clone())
.await;
- if row_changeset.is_empty() == false {
+ if !row_changeset.is_empty() {
with_row_changeset(row_changeset).await;
}
diff --git a/frontend/rust-lib/flowy-grid/src/services/group/configuration.rs b/frontend/rust-lib/flowy-grid/src/services/group/configuration.rs
index 29f8678729..fea71ebbbc 100644
--- a/frontend/rust-lib/flowy-grid/src/services/group/configuration.rs
+++ b/frontend/rust-lib/flowy-grid/src/services/group/configuration.rs
@@ -285,7 +285,7 @@ fn merge_groups(old_groups: &[GroupRevision], groups: Vec<Group>) -> MergeGroupR
}
// Find out the new groups
- let new_groups = group_map.into_values().collect::<Vec<Group>>();
+ let new_groups = group_map.into_values();
for (index, group) in new_groups.into_iter().enumerate() {
merge_result.add_insert_group(index, group);
}
@@ -313,7 +313,7 @@ impl MergeGroupResult {
}
fn add_group(&mut self, group: Group) {
- self.groups.push(group.clone());
+ self.groups.push(group);
}
fn add_insert_group(&mut self, index: usize, group: Group) {
@@ -331,11 +331,10 @@ fn make_group_view_changeset(
inserted_groups: Vec<InsertedGroupPB>,
updated_group: Vec<Group>,
) -> GroupViewChangesetPB {
- let changeset = GroupViewChangesetPB {
+ GroupViewChangesetPB {
view_id,
inserted_groups,
deleted_groups: vec![],
update_groups: updated_group.into_iter().map(GroupPB::from).collect(),
- };
- changeset
+ }
}
diff --git a/frontend/rust-lib/flowy-grid/src/services/group/controller.rs b/frontend/rust-lib/flowy-grid/src/services/group/controller.rs
index fc45a6fc12..562f21eb17 100644
--- a/frontend/rust-lib/flowy-grid/src/services/group/controller.rs
+++ b/frontend/rust-lib/flowy-grid/src/services/group/controller.rs
@@ -98,10 +98,12 @@ where
})
}
+ // https://stackoverflow.com/questions/69413164/how-to-fix-this-clippy-warning-needless-collect
+ #[allow(clippy::needless_collect)]
fn update_default_group(
&mut self,
row_rev: &RowRevision,
- other_group_changesets: &Vec<GroupChangesetPB>,
+ other_group_changesets: &[GroupChangesetPB],
) -> GroupChangesetPB {
let default_group = self.configuration.get_mut_default_group();
@@ -119,15 +121,14 @@ where
.filter(|row_id| {
// if the [other_group_inserted_row] contains the row_id of the row
// which means the row should not move to the default group.
- other_group_inserted_row
+ !other_group_inserted_row
.iter()
- .find(|inserted_row| &inserted_row.row.id == row_id)
- .is_none()
+ .any(|inserted_row| &inserted_row.row.id == row_id)
})
.collect::<Vec<String>>();
let mut changeset = GroupChangesetPB::new(default_group.id.clone());
- if default_group_inserted_row.is_empty() == false {
+ if !default_group_inserted_row.is_empty() {
changeset.inserted_rows.push(InsertedRowPB::new(row_rev.into()));
default_group.add_row(row_rev.into());
}
@@ -146,10 +147,7 @@ where
// if the [other_group_delete_rows] contain the inserted_row, which means this row should move
// out from the default_group.
let inserted_row_id = &inserted_row.row.id;
- other_group_delete_rows
- .iter()
- .find(|row_id| inserted_row_id == row_id.clone())
- .is_none()
+ !other_group_delete_rows.iter().any(|row_id| inserted_row_id == row_id)
})
.collect::<Vec<&InsertedRowPB>>();
@@ -157,8 +155,7 @@ where
for row in &default_group.rows {
if default_group_deleted_rows
.iter()
- .find(|deleted_row| deleted_row.row.id == row.id)
- .is_some()
+ .any(|deleted_row| deleted_row.row.id == row.id)
{
deleted_row_ids.push(row.id.clone());
}