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
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user