@@ -373,7 +373,7 @@ impl Resources {
373
373
/// Resolve omitted keys from the given template.
374
374
fn resolve ( & mut self , template : & Resources ) {
375
375
if self . processes . is_none ( ) {
376
- self . processes = template. processes . clone ( ) ;
376
+ self . processes . clone_from ( & template. processes ) ;
377
377
}
378
378
if self . threads_per_process . is_none ( ) {
379
379
self . threads_per_process = template. threads_per_process ;
@@ -382,7 +382,7 @@ impl Resources {
382
382
self . gpus_per_process = template. gpus_per_process ;
383
383
}
384
384
if self . walltime . is_none ( ) {
385
- self . walltime = template. walltime . clone ( ) ;
385
+ self . walltime . clone_from ( & template. walltime ) ;
386
386
}
387
387
}
388
388
@@ -451,19 +451,19 @@ impl Action {
451
451
/// Resolve the action's omitted keys with defaults
452
452
fn resolve ( & mut self , template : & Action ) {
453
453
if self . name . is_none ( ) {
454
- self . name = template. name . clone ( ) ;
454
+ self . name . clone_from ( & template. name ) ;
455
455
}
456
456
if self . command . is_none ( ) {
457
- self . command = template. command . clone ( ) ;
457
+ self . command . clone_from ( & template. command ) ;
458
458
}
459
459
if self . launchers . is_none ( ) {
460
- self . launchers = template. launchers . clone ( ) ;
460
+ self . launchers . clone_from ( & template. launchers ) ;
461
461
}
462
462
if self . previous_actions . is_none ( ) {
463
- self . previous_actions = template. previous_actions . clone ( ) ;
463
+ self . previous_actions . clone_from ( & template. previous_actions ) ;
464
464
}
465
465
if self . products . is_none ( ) {
466
- self . products = template. products . clone ( ) ;
466
+ self . products . clone_from ( & template. products ) ;
467
467
}
468
468
469
469
self . resources . resolve ( & template. resources ) ;
@@ -477,16 +477,18 @@ impl Action {
477
477
. get_mut ( name)
478
478
. expect ( "Key should be present" ) ;
479
479
if action_options. account . is_none ( ) {
480
- action_options. account = template_options. account . clone ( ) ;
480
+ action_options. account . clone_from ( & template_options. account ) ;
481
481
}
482
482
if action_options. setup . is_none ( ) {
483
- action_options. setup = template_options. setup . clone ( ) ;
483
+ action_options. setup . clone_from ( & template_options. setup ) ;
484
484
}
485
485
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 ) ;
487
489
}
488
490
if action_options. custom . is_empty ( ) {
489
- action_options. custom = template_options. custom . clone ( ) ;
491
+ action_options. custom . clone_from ( & template_options. custom ) ;
490
492
}
491
493
} else {
492
494
self . submit_options
@@ -545,10 +547,10 @@ impl Group {
545
547
/// Resolve omitted keys from the given template.
546
548
fn resolve ( & mut self , template : & Group ) {
547
549
if self . include . is_none ( ) {
548
- self . include = template. include . clone ( ) ;
550
+ self . include . clone_from ( & template. include ) ;
549
551
}
550
552
if self . sort_by . is_none ( ) {
551
- self . sort_by = template. sort_by . clone ( ) ;
553
+ self . sort_by . clone_from ( & template. sort_by ) ;
552
554
}
553
555
if self . split_by_sort_key . is_none ( ) {
554
556
self . split_by_sort_key = template. split_by_sort_key ;
0 commit comments