Skip to content

Commit 6e71d6d

Browse files
committed
chore: fix warnings
1 parent c6d3fd4 commit 6e71d6d

File tree

5 files changed

+24
-26
lines changed

5 files changed

+24
-26
lines changed

frontend/app_flowy/lib/plugins/board/presentation/board_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class _BoardContentState extends State<BoardContent> {
112112
column,
113113
columnItem,
114114
),
115-
columnConstraints: const BoxConstraints.tightFor(width: 240),
115+
columnConstraints: const BoxConstraints.tightFor(width: 300),
116116
config: AFBoardConfig(
117117
columnBackgroundColor: HexColor.fromHex('#F7F8FC'),
118118
),

frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ BoxDecoration _makeBoxDecoration(BuildContext context) {
9393
final theme = context.read<AppTheme>();
9494
final borderSide = BorderSide(color: theme.shader6, width: 1.0);
9595
return BoxDecoration(
96-
color: theme.surface,
96+
color: Colors.transparent,
9797
border: Border.fromBorderSide(borderSide),
98-
boxShadow: [
98+
boxShadow: const [
9999
BoxShadow(
100-
color: theme.shader6,
101-
spreadRadius: 0,
102-
blurRadius: 2,
103-
offset: Offset.zero)
100+
color: Colors.transparent,
101+
spreadRadius: 0,
102+
blurRadius: 2,
103+
offset: Offset.zero,
104+
)
104105
],
105106
borderRadius: const BorderRadius.all(Radius.circular(6)),
106107
);
@@ -120,8 +121,9 @@ class _CardEnterRegion extends StatelessWidget {
120121
builder: (context, onEnter, _) {
121122
List<Widget> children = [child];
122123
if (onEnter) {
123-
children.add(CardAccessoryContainer(accessories: accessories)
124-
.positioned(right: 0));
124+
children.add(CardAccessoryContainer(
125+
accessories: accessories,
126+
).positioned(right: 0));
125127
}
126128

127129
return MouseRegion(

frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl GridViewManager {
142142
.move_group_row(&row_rev, &mut row_changeset, &to_group_id, to_row_id.clone())
143143
.await;
144144

145-
if row_changeset.is_empty() == false {
145+
if !row_changeset.is_empty() {
146146
with_row_changeset(row_changeset).await;
147147
}
148148

frontend/rust-lib/flowy-grid/src/services/group/configuration.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ fn merge_groups(old_groups: &[GroupRevision], groups: Vec<Group>) -> MergeGroupR
285285
}
286286

287287
// Find out the new groups
288-
let new_groups = group_map.into_values().collect::<Vec<Group>>();
288+
let new_groups = group_map.into_values();
289289
for (index, group) in new_groups.into_iter().enumerate() {
290290
merge_result.add_insert_group(index, group);
291291
}
@@ -313,7 +313,7 @@ impl MergeGroupResult {
313313
}
314314

315315
fn add_group(&mut self, group: Group) {
316-
self.groups.push(group.clone());
316+
self.groups.push(group);
317317
}
318318

319319
fn add_insert_group(&mut self, index: usize, group: Group) {
@@ -331,11 +331,10 @@ fn make_group_view_changeset(
331331
inserted_groups: Vec<InsertedGroupPB>,
332332
updated_group: Vec<Group>,
333333
) -> GroupViewChangesetPB {
334-
let changeset = GroupViewChangesetPB {
334+
GroupViewChangesetPB {
335335
view_id,
336336
inserted_groups,
337337
deleted_groups: vec![],
338338
update_groups: updated_group.into_iter().map(GroupPB::from).collect(),
339-
};
340-
changeset
339+
}
341340
}

frontend/rust-lib/flowy-grid/src/services/group/controller.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ where
9898
})
9999
}
100100

101+
// https://stackoverflow.com/questions/69413164/how-to-fix-this-clippy-warning-needless-collect
102+
#[allow(clippy::needless_collect)]
101103
fn update_default_group(
102104
&mut self,
103105
row_rev: &RowRevision,
104-
other_group_changesets: &Vec<GroupChangesetPB>,
106+
other_group_changesets: &[GroupChangesetPB],
105107
) -> GroupChangesetPB {
106108
let default_group = self.configuration.get_mut_default_group();
107109

@@ -119,15 +121,14 @@ where
119121
.filter(|row_id| {
120122
// if the [other_group_inserted_row] contains the row_id of the row
121123
// which means the row should not move to the default group.
122-
other_group_inserted_row
124+
!other_group_inserted_row
123125
.iter()
124-
.find(|inserted_row| &inserted_row.row.id == row_id)
125-
.is_none()
126+
.any(|inserted_row| &inserted_row.row.id == row_id)
126127
})
127128
.collect::<Vec<String>>();
128129

129130
let mut changeset = GroupChangesetPB::new(default_group.id.clone());
130-
if default_group_inserted_row.is_empty() == false {
131+
if !default_group_inserted_row.is_empty() {
131132
changeset.inserted_rows.push(InsertedRowPB::new(row_rev.into()));
132133
default_group.add_row(row_rev.into());
133134
}
@@ -146,19 +147,15 @@ where
146147
// if the [other_group_delete_rows] contain the inserted_row, which means this row should move
147148
// out from the default_group.
148149
let inserted_row_id = &inserted_row.row.id;
149-
other_group_delete_rows
150-
.iter()
151-
.find(|row_id| inserted_row_id == row_id.clone())
152-
.is_none()
150+
!other_group_delete_rows.iter().any(|row_id| inserted_row_id == row_id)
153151
})
154152
.collect::<Vec<&InsertedRowPB>>();
155153

156154
let mut deleted_row_ids = vec![];
157155
for row in &default_group.rows {
158156
if default_group_deleted_rows
159157
.iter()
160-
.find(|deleted_row| deleted_row.row.id == row.id)
161-
.is_some()
158+
.any(|deleted_row| deleted_row.row.id == row.id)
162159
{
163160
deleted_row_ids.push(row.id.clone());
164161
}

0 commit comments

Comments
 (0)