File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,24 +78,23 @@ fn main() {
7878 if what_if { reg_helper. enable_what_if ( ) ; }
7979
8080 // In what-if, if the desired state is _exist: false, route to delete
81- if what_if {
82- if let Ok ( desired) = serde_json:: from_str :: < Registry > ( & input) {
83- if matches ! ( desired. exist, Some ( false ) ) {
84- match reg_helper. remove ( ) {
85- Ok ( Some ( reg_config) ) => {
86- let json = serde_json:: to_string ( & reg_config) . unwrap ( ) ;
87- println ! ( "{json}" ) ;
88- } ,
89- Ok ( None ) => { } ,
90- Err ( err) => {
91- error ! ( "{err}" ) ;
92- exit ( EXIT_REGISTRY_ERROR ) ;
93- }
81+ if what_if
82+ && let Ok ( desired) = serde_json:: from_str :: < Registry > ( & input)
83+ && matches ! ( desired. exist, Some ( false ) ) {
84+ match reg_helper. remove ( ) {
85+ Ok ( Some ( reg_config) ) => {
86+ let json = serde_json:: to_string ( & reg_config) . unwrap ( ) ;
87+ println ! ( "{json}" ) ;
88+ } ,
89+ Ok ( None ) => { } ,
90+ Err ( err) => {
91+ error ! ( "{err}" ) ;
92+ exit ( EXIT_REGISTRY_ERROR ) ;
9493 }
95- return ;
9694 }
95+ return ;
9796 }
98- }
97+
9998 match reg_helper. set ( ) {
10099 Ok ( reg_config) => {
101100 if let Some ( config) = reg_config {
You can’t perform that action at this time.
0 commit comments