net_util: Derive thiserror::Error

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen
2022-08-10 14:58:36 -07:00
committed by Rob Bradford
parent 6a1e637a46
commit f39b08f21f
6 changed files with 42 additions and 35 deletions
+3 -2
View File
@@ -18,6 +18,7 @@ use std::io::Error as IoError;
use std::os::raw::c_uint;
use std::os::unix::io::{FromRawFd, RawFd};
use std::{io, mem, net};
use thiserror::Error;
use versionize::{VersionMap, Versionize, VersionizeResult};
use versionize_derive::Versionize;
use virtio_bindings::bindings::virtio_net::{
@@ -35,9 +36,9 @@ pub use open_tap::{open_tap, Error as OpenTapError};
pub use queue_pair::{NetCounters, NetQueuePair, NetQueuePairError, RxVirtio, TxVirtio};
pub use tap::{Error as TapError, Tap};
#[derive(Debug)]
#[derive(Error, Debug)]
pub enum Error {
/// Failed to create a socket.
#[error("Failed to create a socket: {0}")]
CreateSocket(IoError),
}