clippy: fix warnings from collapsible_if lint
This commit is contained in:
@@ -217,11 +217,13 @@ impl SysFSCpu {
|
||||
.map_err(|err| ChCpuError::io0("write standard output", err));
|
||||
}
|
||||
|
||||
if let Some(enabled_cpu_list) = enabled_cpu_list {
|
||||
if previous_config && !configure && enabled_cpu_list.0.contains(&cpu_index) {
|
||||
if let Some(enabled_cpu_list) = enabled_cpu_list
|
||||
&& previous_config
|
||||
&& !configure
|
||||
&& enabled_cpu_list.0.contains(&cpu_index)
|
||||
{
|
||||
return Err(ChCpuError::CpuIsEnabled(cpu_index));
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(err) = self.write_value(&configure_path, u8::from(configure)) {
|
||||
let operation = if configure {
|
||||
|
||||
@@ -341,12 +341,12 @@ pub(crate) fn describe(
|
||||
let now = time_of_day()?;
|
||||
let sys_v_ipc = SysVIpc::new(id)?;
|
||||
|
||||
if let Some(id) = id {
|
||||
if sys_v_ipc.0.len() != 1 {
|
||||
if let Some(id) = id
|
||||
&& sys_v_ipc.0.len() != 1
|
||||
{
|
||||
eprintln!("id {id} not found");
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
table.set_name(c"messages")?;
|
||||
|
||||
|
||||
@@ -410,12 +410,12 @@ pub(crate) fn describe(
|
||||
let now = time_of_day()?;
|
||||
let sys_v_ipc = SysVIpc::new(id)?;
|
||||
|
||||
if let Some(id) = id {
|
||||
if sys_v_ipc.0.len() != 1 {
|
||||
if let Some(id) = id
|
||||
&& sys_v_ipc.0.len() != 1
|
||||
{
|
||||
eprintln!("id {id} not found");
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
table.set_name(c"semaphores")?;
|
||||
|
||||
|
||||
@@ -391,12 +391,12 @@ pub(crate) fn describe(
|
||||
let now = time_of_day()?;
|
||||
let sys_v_ipc = SysVIpc::new(id)?;
|
||||
|
||||
if let Some(id) = id {
|
||||
if sys_v_ipc.0.len() != 1 {
|
||||
if let Some(id) = id
|
||||
&& sys_v_ipc.0.len() != 1
|
||||
{
|
||||
eprintln!("id {id} not found");
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
table.set_name(c"sharedmemory")?;
|
||||
|
||||
|
||||
@@ -275,8 +275,10 @@ impl LockInfo {
|
||||
|
||||
let range = start..end;
|
||||
|
||||
if let Some(pid_locks) = pid_locks {
|
||||
if command_name.is_none() && !blocked {
|
||||
if let Some(pid_locks) = pid_locks
|
||||
&& command_name.is_none()
|
||||
&& !blocked
|
||||
{
|
||||
let lock_compare = |lock: &&LockInfo| {
|
||||
lock.range == range
|
||||
&& lock.inode == inode
|
||||
@@ -292,7 +294,6 @@ impl LockInfo {
|
||||
command_name = found.command_name.clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if command_name.is_none() {
|
||||
command_name = if unknown_command_name {
|
||||
|
||||
Reference in New Issue
Block a user