fix some clippy warnings
This commit is contained in:
parent
e993111309
commit
6c78dce4c1
2 changed files with 6 additions and 16 deletions
|
|
@ -317,7 +317,7 @@ impl Device {
|
||||||
Ok(handle) => handle,
|
Ok(handle) => handle,
|
||||||
};
|
};
|
||||||
|
|
||||||
let hw_params = alsa::pcm::HwParams::any(&handle)?;
|
let hw_params = alsa::pcm::HwParams::any(handle)?;
|
||||||
|
|
||||||
// TODO: check endianess
|
// TODO: check endianess
|
||||||
const FORMATS: [(SampleFormat, alsa::pcm::Format); 3] = [
|
const FORMATS: [(SampleFormat, alsa::pcm::Format); 3] = [
|
||||||
|
|
|
||||||
|
|
@ -121,24 +121,18 @@ impl Device {
|
||||||
min_sample_rate: f.sample_rate,
|
min_sample_rate: f.sample_rate,
|
||||||
max_sample_rate: f.sample_rate,
|
max_sample_rate: f.sample_rate,
|
||||||
buffer_size: f.buffer_size.clone(),
|
buffer_size: f.buffer_size.clone(),
|
||||||
sample_format: f.sample_format.clone(),
|
sample_format: f.sample_format,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
supported_configs
|
supported_configs
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_input(&self) -> bool {
|
pub fn is_input(&self) -> bool {
|
||||||
match self.device_type {
|
matches!(self.device_type, DeviceType::InputDevice)
|
||||||
DeviceType::InputDevice => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_output(&self) -> bool {
|
pub fn is_output(&self) -> bool {
|
||||||
match self.device_type {
|
matches!(self.device_type, DeviceType::OutputDevice)
|
||||||
DeviceType::OutputDevice => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,9 +196,7 @@ impl DeviceTrait for Device {
|
||||||
Ok(c) => client = c,
|
Ok(c) => client = c,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
return Err(BuildStreamError::BackendSpecific {
|
return Err(BuildStreamError::BackendSpecific {
|
||||||
err: BackendSpecificError {
|
err: BackendSpecificError { description: e },
|
||||||
description: e.to_string(),
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -243,9 +235,7 @@ impl DeviceTrait for Device {
|
||||||
Ok(c) => client = c,
|
Ok(c) => client = c,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
return Err(BuildStreamError::BackendSpecific {
|
return Err(BuildStreamError::BackendSpecific {
|
||||||
err: BackendSpecificError {
|
err: BackendSpecificError { description: e },
|
||||||
description: e.to_string(),
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue