mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-29 17:09:25 +00:00
i2c: run clippy --fix
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
This commit is contained in:
parent
d88b12b9e0
commit
c0051585e4
@ -382,7 +382,7 @@ impl I2cDevice for PhysDevice {
|
||||
AdapterIdentifier::Name(adapter_name) => PhysDevice::find_adapter(adapter_name)?,
|
||||
AdapterIdentifier::Number(no) => *no,
|
||||
};
|
||||
let device_path = format!("/dev/i2c-{}", adapter_no);
|
||||
let device_path = format!("/dev/i2c-{adapter_no}");
|
||||
|
||||
Self::open_with(&device_path, adapter_no)
|
||||
}
|
||||
|
||||
@ -82,8 +82,8 @@ enum AdapterIdentifier {
|
||||
impl fmt::Display for AdapterIdentifier {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
AdapterIdentifier::Name(name) => write!(f, "adapter_name: {}", name),
|
||||
AdapterIdentifier::Number(no) => write!(f, "adapter_no:: {}", no),
|
||||
AdapterIdentifier::Name(name) => write!(f, "adapter_name: {name}"),
|
||||
AdapterIdentifier::Number(no) => write!(f, "adapter_no:: {no}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ pub(crate) enum Error {
|
||||
|
||||
impl convert::From<Error> for io::Error {
|
||||
fn from(e: Error) -> Self {
|
||||
io::Error::new(io::ErrorKind::Other, e)
|
||||
io::Error::other(e)
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ impl<D: 'static + I2cDevice + Sync + Send> VhostUserBackendMut for VhostUserI2cB
|
||||
}
|
||||
|
||||
_ => {
|
||||
warn!("unhandled device_event: {}", device_event);
|
||||
warn!("unhandled device_event: {device_event}");
|
||||
return Err(Error::HandleEventUnknown.into());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user