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:
Philipp Schuster
2025-06-12 16:44:11 +02:00
committed by Rob Bradford
parent d594107c0d
commit 9bd9c0cb71
7 changed files with 6 additions and 42 deletions

View File

@@ -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,