From cb03540ffdd38d88d4430ad71885fa7d2f1ded77 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 22 Apr 2022 16:45:03 +0100 Subject: [PATCH] vmm: config: Derive thiserror::Error No further changes are necessary that adding a #[derive(Error)] as there is a manual implementation of Display. Signed-off-by: Rob Bradford --- vmm/src/config.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 19e800a09..c61920aef 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -15,7 +15,7 @@ use std::net::Ipv4Addr; use std::path::PathBuf; use std::result; use std::str::FromStr; - +use thiserror::Error; use virtio_devices::{RateLimiterConfig, TokenBucketConfig}; pub const DEFAULT_VCPUS: u8 = 1; @@ -36,7 +36,7 @@ pub const DEFAULT_NUM_PCI_SEGMENTS: u16 = 1; const MAX_NUM_PCI_SEGMENTS: u16 = 16; /// Errors associated with VM configuration parameters. -#[derive(Debug)] +#[derive(Debug, Error)] pub enum Error { /// Filesystem tag is missing ParseFsTagMissing, @@ -114,7 +114,7 @@ pub enum Error { ParseVdpaPathMissing, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Error)] pub enum ValidationError { /// Both console and serial are tty. DoubleTtyMode,