Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 1774f36

Browse files
author
Joe Grund
authored
Fix GUI clippy issues (#1953)
Rust 1.44 made `vec![]` expand to `Vec::new()` (rust-lang/rust#70632). As such clippy is now (somewhat correctly) interpreting that the macro could be used points-free. clippy should be smart enough to not substitute the expanded macro, but for now we can silence the errors by using a points-free constructor. Fixes #1949. Signed-off-by: Joe Grund <jgrund@whamcloud.io>
1 parent 2c28813 commit 1774f36

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

iml-gui/crate/src/components/action_dropdown/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn group_actions_by_label(xs: Vec<Arc<AvailableAction>>, cache: &ArcCache) -> Ac
246246
let mut x = xs.into_iter().fold(BTreeMap::new(), |mut x, action| {
247247
match cache.get_erased_record(&action.composite_id) {
248248
Some(r) => {
249-
let xs = x.entry(r.label().to_string()).or_insert_with(|| vec![]);
249+
let xs = x.entry(r.label().to_string()).or_insert_with(Vec::new);
250250

251251
xs.push((action, r));
252252
}

iml-gui/crate/src/page/servers.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,8 @@ pub fn view(
203203
.merge_attrs(class![C.text_center]),
204204
table::td_view(date_view(sd, &x.boot_time)).merge_attrs(class![C.text_center]),
205205
table::td_view(span![x.server_profile.ui_name]).merge_attrs(class![C.text_center]),
206-
table::td_view(
207-
div![lnet_by_server_view(x, cache, all_locks).unwrap_or_else(|| vec![])]
208-
)
209-
.merge_attrs(class![C.text_center]),
206+
table::td_view(div![lnet_by_server_view(x, cache, all_locks).unwrap_or_else(Vec::new)])
207+
.merge_attrs(class![C.text_center]),
210208
td![
211209
class![C.p_3, C.text_center],
212210
action_dropdown::view(x.id, &row.dropdown, all_locks, session)

0 commit comments

Comments
 (0)