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 <dverkamp@chromium.org>
This commit is contained in:
parent
c4cd1d375e
commit
cc4da710ac
1 changed files with 6 additions and 6 deletions
|
|
@ -140,9 +140,9 @@ pub enum MasterReq {
|
|||
MAX_CMD = 41,
|
||||
}
|
||||
|
||||
impl Into<u32> for MasterReq {
|
||||
fn into(self) -> u32 {
|
||||
self as u32
|
||||
impl From<MasterReq> for u32 {
|
||||
fn from(req: MasterReq) -> u32 {
|
||||
req as u32
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -180,9 +180,9 @@ pub enum SlaveReq {
|
|||
MAX_CMD = 10,
|
||||
}
|
||||
|
||||
impl Into<u32> for SlaveReq {
|
||||
fn into(self) -> u32 {
|
||||
self as u32
|
||||
impl From<SlaveReq> for u32 {
|
||||
fn from(req: SlaveReq) -> u32 {
|
||||
req as u32
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue