mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: replace manual From<T> for *Error with #[from]
This is a small simplification we can use since we use `thiserror` anyway. Note that `#[from]` implies `#[source]` [0]. [0]: https://docs.rs/thiserror/2.0.12/thiserror/index.html Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
d594107c0d
commit
9bd9c0cb71
@@ -40,7 +40,7 @@ pub enum Error {
|
||||
#[error("Failed to parse: {0}")]
|
||||
Parsing(#[source] std::num::ParseIntError),
|
||||
#[error("ssh command failed: {0}")]
|
||||
SshCommand(#[source] SshCommandError),
|
||||
SshCommand(#[from] SshCommandError),
|
||||
#[error("waiting for boot failed: {0}")]
|
||||
WaitForBoot(#[source] WaitForBootError),
|
||||
#[error("reading log file failed: {0}")]
|
||||
@@ -57,12 +57,6 @@ pub enum Error {
|
||||
WaitTimeout(#[source] WaitTimeoutError),
|
||||
}
|
||||
|
||||
impl From<SshCommandError> for Error {
|
||||
fn from(e: SshCommandError) -> Self {
|
||||
Self::SshCommand(e)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct GuestNetworkConfig {
|
||||
pub guest_ip: String,
|
||||
pub l2_guest_ip1: String,
|
||||
|
||||
Reference in New Issue
Block a user