@@ -135,7 +135,7 @@ fn check_previous_rollback() -> Result<bool> {
135135 // Check for specific success indicators
136136 let success = journal_output. contains ( "Rollback successful" ) ;
137137
138- log:: debug!( "Rollback detection result: {}" , success ) ;
138+ log:: debug!( "Rollback detection result: {success}" ) ;
139139 Ok ( success)
140140}
141141
@@ -167,10 +167,7 @@ fn health_check() -> Result<()> {
167167 status
168168 }
169169 Err ( e) => {
170- log:: warn!(
171- "Failed to check previous rollback status: {}. Defaulting to false." ,
172- e
173- ) ;
170+ log:: warn!( "Failed to check previous rollback status: {e}. Defaulting to false." ) ;
174171 false
175172 }
176173 } ;
@@ -194,7 +191,7 @@ fn health_check() -> Result<()> {
194191 "Greenboot healthcheck passed - status is GREEN" ,
195192 previous_rollback,
196193 ) ?)
197- . unwrap_or_else ( |e| log:: error!( "cannot set motd: {}" , e ) ) ;
194+ . unwrap_or_else ( |e| log:: error!( "cannot set motd: {e}" ) ) ;
198195 set_boot_status ( true , GRUB_PATH , MOUNT_INFO_PATH ) ?;
199196 Ok ( ( ) )
200197 }
@@ -205,18 +202,18 @@ fn health_check() -> Result<()> {
205202 "Greenboot healthcheck failed - status is RED" ,
206203 previous_rollback,
207204 ) ?)
208- . unwrap_or_else ( |e| log:: error!( "cannot set motd: {}" , e ) ) ;
205+ . unwrap_or_else ( |e| log:: error!( "cannot set motd: {e}" ) ) ;
209206 let errors = run_red ( ) ;
210207 if !errors. is_empty ( ) {
211208 log:: error!( "There is a problem with red script runner" ) ;
212209 errors. iter ( ) . for_each ( |e| log:: error!( "{e}" ) ) ;
213210 }
214211
215212 set_boot_status ( false , GRUB_PATH , MOUNT_INFO_PATH )
216- . unwrap_or_else ( |e| log:: error!( "cannot set boot_status: {}" , e ) ) ;
213+ . unwrap_or_else ( |e| log:: error!( "cannot set boot_status: {e}" ) ) ;
217214 set_boot_counter ( config. max_reboot , GRUB_PATH , MOUNT_INFO_PATH )
218- . unwrap_or_else ( |e| log:: error!( "cannot set boot_counter: {}" , e ) ) ;
219- handle_reboot ( false ) . unwrap_or_else ( |e| log:: error!( "cannot reboot: {}" , e ) ) ;
215+ . unwrap_or_else ( |e| log:: error!( "cannot set boot_counter: {e}" ) ) ;
216+ handle_reboot ( false ) . unwrap_or_else ( |e| log:: error!( "cannot reboot: {e}" ) ) ;
220217 bail ! ( "greenboot healthcheck failed" )
221218 }
222219 }
@@ -239,7 +236,7 @@ fn trigger_rollback() -> Result<()> {
239236// This function parses a string expected in bash-array format like
240237// `( "item1" "item2" ... )` into a Vec<String>.
241238fn parse_bash_array_string ( raw_str : & str ) -> Vec < String > {
242- log:: debug!( "Attempting to parse raw bash-array string: '{}'" , raw_str ) ;
239+ log:: debug!( "Attempting to parse raw bash-array string: '{raw_str }'" ) ;
243240
244241 if raw_str. starts_with ( '(' ) && raw_str. ends_with ( ')' ) {
245242 // Remove the outer parentheses
@@ -252,14 +249,13 @@ fn parse_bash_array_string(raw_str: &str) -> Vec<String> {
252249 . filter ( |s| !s. is_empty ( ) )
253250 . collect ( ) ;
254251
255- log:: debug!( "Parsed list from bash-array string: {:?}" , parsed_list ) ;
252+ log:: debug!( "Parsed list from bash-array string: {parsed_list :?}" ) ;
256253 parsed_list
257254 } else if !raw_str. trim ( ) . is_empty ( ) {
258255 // If the string is not empty but doesn't match the expected format,
259256 // log a warning and return an empty list.
260257 log:: warn!(
261- "String ('{}') is not in the expected bash-array format '( \" item1\" ... )'. Treating as empty list." ,
262- raw_str
258+ "String ('{raw_str}') is not in the expected bash-array format '( \" item1\" ... )'. Treating as empty list."
263259 ) ;
264260 vec ! [ ]
265261 } else {
0 commit comments