6868 ///
6969 /// Returns an error if the project cannot be discovered, has no packages, or
7070 /// if the changeset cannot be written.
71- pub fn execute ( & self , start_path : & Path , input : AddInput ) -> Result < AddResult > {
71+ pub fn execute ( & self , start_path : & Path , input : & AddInput ) -> Result < AddResult > {
7272 let project = self . project_provider . discover_project ( start_path) ?;
7373
7474 if project. packages ( ) . is_empty ( ) {
@@ -104,7 +104,7 @@ where
104104 } ) ;
105105
106106 let packages =
107- match self . select_packages ( project. packages ( ) , & input, display_labels. as_deref ( ) ) ? {
107+ match self . select_packages ( project. packages ( ) , input, display_labels. as_deref ( ) ) ? {
108108 Some ( packages) if packages. is_empty ( ) => return Ok ( AddResult :: NoPackages ) ,
109109 Some ( packages) => packages,
110110 None => return Ok ( AddResult :: Cancelled ) ,
@@ -120,15 +120,15 @@ where
120120 Vec :: new ( )
121121 } ;
122122
123- let Some ( releases) = self . collect_releases ( & packages, & input) ? else {
123+ let Some ( releases) = self . collect_releases ( & packages, input) ? else {
124124 return Ok ( AddResult :: Cancelled ) ;
125125 } ;
126126
127- let Some ( category) = self . select_category ( & input) ? else {
127+ let Some ( category) = self . select_category ( input) ? else {
128128 return Ok ( AddResult :: Cancelled ) ;
129129 } ;
130130
131- let Some ( desc) = self . get_description ( & input) ? else {
131+ let Some ( desc) = self . get_description ( input) ? else {
132132 return Ok ( AddResult :: Cancelled ) ;
133133 } ;
134134
@@ -354,7 +354,7 @@ mod tests {
354354 } ;
355355
356356 let result = operation
357- . execute ( Path :: new ( "/any" ) , input)
357+ . execute ( Path :: new ( "/any" ) , & input)
358358 . expect ( "AddOperation failed with valid single-package input" ) ;
359359
360360 match result {
@@ -393,7 +393,7 @@ mod tests {
393393 } ;
394394
395395 let result = operation
396- . execute ( Path :: new ( "/any" ) , input)
396+ . execute ( Path :: new ( "/any" ) , & input)
397397 . expect ( "AddOperation failed with valid multi-package input" ) ;
398398
399399 match result {
@@ -420,7 +420,7 @@ mod tests {
420420 let operation = AddOperation :: new ( project_provider, writer, interaction) ;
421421
422422 let result = operation
423- . execute ( Path :: new ( "/any" ) , AddInput :: default ( ) )
423+ . execute ( Path :: new ( "/any" ) , & AddInput :: default ( ) )
424424 . expect ( "AddOperation should not fail when interaction is cancelled" ) ;
425425
426426 assert ! ( matches!( result, AddResult :: Cancelled ) ) ;
@@ -441,7 +441,7 @@ mod tests {
441441 let operation = AddOperation :: new ( project_provider, writer, interaction) ;
442442
443443 let result = operation
444- . execute ( Path :: new ( "/any" ) , AddInput :: default ( ) )
444+ . execute ( Path :: new ( "/any" ) , & AddInput :: default ( ) )
445445 . expect ( "AddOperation should not fail when bump selection is cancelled" ) ;
446446
447447 assert ! ( matches!( result, AddResult :: Cancelled ) ) ;
@@ -462,7 +462,7 @@ mod tests {
462462 ..Default :: default ( )
463463 } ;
464464
465- let result = operation. execute ( Path :: new ( "/any" ) , input) ;
465+ let result = operation. execute ( Path :: new ( "/any" ) , & input) ;
466466
467467 assert ! ( result. is_err( ) ) ;
468468 let err = result. expect_err ( "AddOperation should fail for unknown package" ) ;
@@ -484,7 +484,7 @@ mod tests {
484484 ..Default :: default ( )
485485 } ;
486486
487- let result = operation. execute ( Path :: new ( "/any" ) , input) ;
487+ let result = operation. execute ( Path :: new ( "/any" ) , & input) ;
488488
489489 assert ! ( result. is_err( ) ) ;
490490 let err = result. expect_err ( "AddOperation should fail for empty description" ) ;
@@ -507,7 +507,7 @@ mod tests {
507507 let operation = AddOperation :: new ( project_provider, writer, interaction) ;
508508
509509 let result = operation
510- . execute ( Path :: new ( "/any" ) , AddInput :: default ( ) )
510+ . execute ( Path :: new ( "/any" ) , & AddInput :: default ( ) )
511511 . expect ( "AddOperation failed with interactive workspace selection" ) ;
512512
513513 match result {
@@ -538,7 +538,7 @@ mod tests {
538538 } ;
539539
540540 let result = operation
541- . execute ( Path :: new ( "/any" ) , input)
541+ . execute ( Path :: new ( "/any" ) , & input)
542542 . expect ( "AddOperation failed for single-package auto-selection" ) ;
543543
544544 match result {
@@ -568,7 +568,7 @@ mod tests {
568568 } ;
569569
570570 let result = operation
571- . execute ( Path :: new ( "/any" ) , input)
571+ . execute ( Path :: new ( "/any" ) , & input)
572572 . expect ( "AddOperation failed with explicit category" ) ;
573573
574574 match result {
@@ -595,7 +595,7 @@ mod tests {
595595 } ;
596596
597597 let result = operation
598- . execute ( Path :: new ( "/any" ) , input)
598+ . execute ( Path :: new ( "/any" ) , & input)
599599 . expect ( "AddOperation failed to create changeset file" ) ;
600600
601601 match result {
@@ -621,7 +621,7 @@ mod tests {
621621 ..Default :: default ( )
622622 } ;
623623
624- let result = operation. execute ( Path :: new ( "/any" ) , input) ;
624+ let result = operation. execute ( Path :: new ( "/any" ) , & input) ;
625625
626626 assert ! ( result. is_err( ) ) ;
627627 let err = result. expect_err ( "AddOperation should fail for none bump without description" ) ;
@@ -644,7 +644,7 @@ mod tests {
644644 } ;
645645
646646 let result = operation
647- . execute ( Path :: new ( "/any" ) , input)
647+ . execute ( Path :: new ( "/any" ) , & input)
648648 . expect ( "AddOperation should succeed for none bump with description" ) ;
649649
650650 match result {
@@ -677,7 +677,7 @@ mod tests {
677677 } ;
678678
679679 let result = operation
680- . execute ( Path :: new ( "/any" ) , input)
680+ . execute ( Path :: new ( "/any" ) , & input)
681681 . expect ( "AddOperation should succeed with interactive description for none bump" ) ;
682682
683683 match result {
@@ -710,7 +710,7 @@ mod tests {
710710 } ;
711711
712712 let result = operation
713- . execute ( Path :: new ( "/any" ) , input)
713+ . execute ( Path :: new ( "/any" ) , & input)
714714 . expect ( "AddOperation should succeed for mixed none/patch bumps with description" ) ;
715715
716716 match result {
@@ -756,7 +756,7 @@ mod tests {
756756 } ;
757757
758758 let result = operation
759- . execute ( Path :: new ( "/any" ) , input)
759+ . execute ( Path :: new ( "/any" ) , & input)
760760 . expect ( "AddOperation should succeed with exclude_dependents" ) ;
761761
762762 match result {
@@ -791,7 +791,7 @@ mod tests {
791791 } ;
792792
793793 let result = operation
794- . execute ( Path :: new ( "/any" ) , input)
794+ . execute ( Path :: new ( "/any" ) , & input)
795795 . expect ( "AddOperation should succeed and report uncovered dependents" ) ;
796796
797797 match result {
@@ -823,7 +823,7 @@ mod tests {
823823 } ;
824824
825825 let result = operation
826- . execute ( Path :: new ( "/any" ) , input)
826+ . execute ( Path :: new ( "/any" ) , & input)
827827 . expect ( "AddOperation should succeed for single-package project" ) ;
828828
829829 match result {
0 commit comments