Skip to content

Commit c53f0b8

Browse files
committed
Address clippy 1.78 checks.
1 parent 722ea81 commit c53f0b8

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

src/launcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ mod tests {
230230
setup();
231231
let launchers = Configuration::built_in();
232232
let launchers_by_cluster = launchers.by_cluster("any_cluster");
233-
assert!(launchers_by_cluster.get("unset_launcher").is_none());
233+
assert!(!launchers_by_cluster.contains_key("unset_launcher"));
234234
}
235235

236236
#[test]

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![allow(clippy::cast_precision_loss)]
66
#![allow(clippy::cast_possible_wrap)]
77
#![allow(clippy::cast_possible_truncation)]
8+
#![allow(clippy::cast_sign_loss)]
89
#![allow(clippy::must_use_candidate)]
910
#![warn(clippy::format_push_string)]
1011

src/workflow.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ impl Resources {
373373
/// Resolve omitted keys from the given template.
374374
fn resolve(&mut self, template: &Resources) {
375375
if self.processes.is_none() {
376-
self.processes = template.processes.clone();
376+
self.processes.clone_from(&template.processes);
377377
}
378378
if self.threads_per_process.is_none() {
379379
self.threads_per_process = template.threads_per_process;
@@ -382,7 +382,7 @@ impl Resources {
382382
self.gpus_per_process = template.gpus_per_process;
383383
}
384384
if self.walltime.is_none() {
385-
self.walltime = template.walltime.clone();
385+
self.walltime.clone_from(&template.walltime);
386386
}
387387
}
388388

@@ -451,19 +451,19 @@ impl Action {
451451
/// Resolve the action's omitted keys with defaults
452452
fn resolve(&mut self, template: &Action) {
453453
if self.name.is_none() {
454-
self.name = template.name.clone();
454+
self.name.clone_from(&template.name);
455455
}
456456
if self.command.is_none() {
457-
self.command = template.command.clone();
457+
self.command.clone_from(&template.command);
458458
}
459459
if self.launchers.is_none() {
460-
self.launchers = template.launchers.clone();
460+
self.launchers.clone_from(&template.launchers);
461461
}
462462
if self.previous_actions.is_none() {
463-
self.previous_actions = template.previous_actions.clone();
463+
self.previous_actions.clone_from(&template.previous_actions);
464464
}
465465
if self.products.is_none() {
466-
self.products = template.products.clone();
466+
self.products.clone_from(&template.products);
467467
}
468468

469469
self.resources.resolve(&template.resources);
@@ -477,16 +477,18 @@ impl Action {
477477
.get_mut(name)
478478
.expect("Key should be present");
479479
if action_options.account.is_none() {
480-
action_options.account = template_options.account.clone();
480+
action_options.account.clone_from(&template_options.account);
481481
}
482482
if action_options.setup.is_none() {
483-
action_options.setup = template_options.setup.clone();
483+
action_options.setup.clone_from(&template_options.setup);
484484
}
485485
if action_options.partition.is_none() {
486-
action_options.partition = template_options.partition.clone();
486+
action_options
487+
.partition
488+
.clone_from(&template_options.partition);
487489
}
488490
if action_options.custom.is_empty() {
489-
action_options.custom = template_options.custom.clone();
491+
action_options.custom.clone_from(&template_options.custom);
490492
}
491493
} else {
492494
self.submit_options
@@ -545,10 +547,10 @@ impl Group {
545547
/// Resolve omitted keys from the given template.
546548
fn resolve(&mut self, template: &Group) {
547549
if self.include.is_none() {
548-
self.include = template.include.clone();
550+
self.include.clone_from(&template.include);
549551
}
550552
if self.sort_by.is_none() {
551-
self.sort_by = template.sort_by.clone();
553+
self.sort_by.clone_from(&template.sort_by);
552554
}
553555
if self.split_by_sort_key.is_none() {
554556
self.split_by_sort_key = template.split_by_sort_key;

0 commit comments

Comments
 (0)