File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,10 +217,12 @@ impl SysFSCpu {
217217 . map_err ( |err| ChCpuError :: io0 ( "write standard output" , err) ) ;
218218 }
219219
220- if let Some ( enabled_cpu_list) = enabled_cpu_list {
221- if previous_config && !configure && enabled_cpu_list. 0 . contains ( & cpu_index) {
222- return Err ( ChCpuError :: CpuIsEnabled ( cpu_index) ) ;
223- }
220+ if let Some ( enabled_cpu_list) = enabled_cpu_list
221+ && previous_config
222+ && !configure
223+ && enabled_cpu_list. 0 . contains ( & cpu_index)
224+ {
225+ return Err ( ChCpuError :: CpuIsEnabled ( cpu_index) ) ;
224226 }
225227
226228 if let Err ( err) = self . write_value ( & configure_path, u8:: from ( configure) ) {
Original file line number Diff line number Diff line change @@ -341,11 +341,11 @@ pub(crate) fn describe(
341341 let now = time_of_day ( ) ?;
342342 let sys_v_ipc = SysVIpc :: new ( id) ?;
343343
344- if let Some ( id) = id {
345- if sys_v_ipc. 0 . len ( ) != 1 {
346- eprintln ! ( "id {id} not found" ) ;
347- return Ok ( ( ) ) ;
348- }
344+ if let Some ( id) = id
345+ && sys_v_ipc. 0 . len ( ) != 1
346+ {
347+ eprintln ! ( "id {id} not found" ) ;
348+ return Ok ( ( ) ) ;
349349 }
350350
351351 table. set_name ( c"messages" ) ?;
Original file line number Diff line number Diff line change @@ -410,11 +410,11 @@ pub(crate) fn describe(
410410 let now = time_of_day ( ) ?;
411411 let sys_v_ipc = SysVIpc :: new ( id) ?;
412412
413- if let Some ( id) = id {
414- if sys_v_ipc. 0 . len ( ) != 1 {
415- eprintln ! ( "id {id} not found" ) ;
416- return Ok ( ( ) ) ;
417- }
413+ if let Some ( id) = id
414+ && sys_v_ipc. 0 . len ( ) != 1
415+ {
416+ eprintln ! ( "id {id} not found" ) ;
417+ return Ok ( ( ) ) ;
418418 }
419419
420420 table. set_name ( c"semaphores" ) ?;
Original file line number Diff line number Diff line change @@ -391,11 +391,11 @@ pub(crate) fn describe(
391391 let now = time_of_day ( ) ?;
392392 let sys_v_ipc = SysVIpc :: new ( id) ?;
393393
394- if let Some ( id) = id {
395- if sys_v_ipc. 0 . len ( ) != 1 {
396- eprintln ! ( "id {id} not found" ) ;
397- return Ok ( ( ) ) ;
398- }
394+ if let Some ( id) = id
395+ && sys_v_ipc. 0 . len ( ) != 1
396+ {
397+ eprintln ! ( "id {id} not found" ) ;
398+ return Ok ( ( ) ) ;
399399 }
400400
401401 table. set_name ( c"sharedmemory" ) ?;
Original file line number Diff line number Diff line change @@ -275,22 +275,23 @@ impl LockInfo {
275275
276276 let range = start..end;
277277
278- if let Some ( pid_locks) = pid_locks {
279- if command_name. is_none ( ) && !blocked {
280- let lock_compare = |lock : & & LockInfo | {
281- lock. range == range
282- && lock. inode == inode
283- && lock. device_id == device_id
284- && lock. mandatory == mandatory
285- && lock. blocked == blocked
286- && lock. kind == kind
287- && lock. mode == mode
288- } ;
289-
290- if let Some ( found) = pid_locks. iter ( ) . find ( lock_compare) {
291- process_id = found. process_id ;
292- command_name = found. command_name . clone ( ) ;
293- }
278+ if let Some ( pid_locks) = pid_locks
279+ && command_name. is_none ( )
280+ && !blocked
281+ {
282+ let lock_compare = |lock : & & LockInfo | {
283+ lock. range == range
284+ && lock. inode == inode
285+ && lock. device_id == device_id
286+ && lock. mandatory == mandatory
287+ && lock. blocked == blocked
288+ && lock. kind == kind
289+ && lock. mode == mode
290+ } ;
291+
292+ if let Some ( found) = pid_locks. iter ( ) . find ( lock_compare) {
293+ process_id = found. process_id ;
294+ command_name = found. command_name . clone ( ) ;
294295 }
295296 }
296297
You can’t perform that action at this time.
0 commit comments