From cc4da710ac68ca8ffe68cddcd80d562699445522 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 7 May 2021 12:22:04 -0700 Subject: [PATCH] vhost_user: implement From instead of Into Implementing From<...> provides the equivalent Into<..> automatically, so this form is preferred. Fixes the clippy from_over_into warning: https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into Signed-off-by: Daniel Verkamp --- src/vhost_user/message.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vhost_user/message.rs b/src/vhost_user/message.rs index 32b2f8c..e906fb1 100644 --- a/src/vhost_user/message.rs +++ b/src/vhost_user/message.rs @@ -140,9 +140,9 @@ pub enum MasterReq { MAX_CMD = 41, } -impl Into for MasterReq { - fn into(self) -> u32 { - self as u32 +impl From for u32 { + fn from(req: MasterReq) -> u32 { + req as u32 } } @@ -180,9 +180,9 @@ pub enum SlaveReq { MAX_CMD = 10, } -impl Into for SlaveReq { - fn into(self) -> u32 { - self as u32 +impl From for u32 { + fn from(req: SlaveReq) -> u32 { + req as u32 } }