@@ -15,21 +15,6 @@ impl SuAction {
1515 pub fn from_env ( ) -> Result < Self , String > {
1616 SuOptions :: parse_arguments ( std:: env:: args ( ) ) ?. validate ( )
1717 }
18-
19- #[ cfg( test) ]
20- pub fn parse_arguments ( args : impl IntoIterator < Item = String > ) -> Result < Self , String > {
21- SuOptions :: parse_arguments ( args) ?. validate ( )
22- }
23-
24- #[ cfg( test) ]
25- #[ allow( clippy:: result_large_err) ]
26- pub fn try_into_run ( self ) -> Result < SuRunOptions , Self > {
27- if let Self :: Run ( v) = self {
28- Ok ( v)
29- } else {
30- Err ( self )
31- }
32- }
3318}
3419
3520#[ cfg_attr( test, derive( Debug , PartialEq ) ) ]
@@ -195,7 +180,7 @@ impl<T> IsAbsent for Vec<T> {
195180}
196181
197182#[ derive( Debug , Default , PartialEq ) ]
198- struct SuOptions {
183+ pub ( super ) struct SuOptions {
199184 // -c
200185 command : Option < String > ,
201186 // -g
@@ -380,7 +365,9 @@ impl SuOptions {
380365 ] ;
381366
382367 /// parse su arguments into SuOptions struct
383- fn parse_arguments ( arguments : impl IntoIterator < Item = String > ) -> Result < SuOptions , String > {
368+ pub ( super ) fn parse_arguments (
369+ arguments : impl IntoIterator < Item = String > ,
370+ ) -> Result < SuOptions , String > {
384371 let mut options: SuOptions = SuOptions :: default ( ) ;
385372 let mut arg_iter = arguments. into_iter ( ) . skip ( 1 ) ;
386373
@@ -460,7 +447,7 @@ impl SuOptions {
460447 Ok ( options)
461448 }
462449
463- fn validate ( self ) -> Result < SuAction , String > {
450+ pub ( super ) fn validate ( self ) -> Result < SuAction , String > {
464451 let action = if self . help {
465452 SuAction :: Help ( self . try_into ( ) ?)
466453 } else if self . version {
0 commit comments