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

@@ -25,17 +25,11 @@ enum Error {
#[error("boot time could not be parsed")]
BootTimeParse,
#[error("infrastructure failure: {0}")]
Infra(#[source] InfraError),
Infra(#[from] InfraError),
#[error("restore time could not be parsed")]
RestoreTimeParse,
}
impl From<InfraError> for Error {
fn from(e: InfraError) -> Self {
Self::Infra(e)
}
}
const BLK_IO_TEST_IMG: &str = "/var/tmp/ch-blk-io-test.img";
pub fn init_tests() {