From 6dc3d60b2d5434408a87f3e09b152edce7589530 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 25 Mar 2021 16:54:09 +0000 Subject: [PATCH] block_util: Address Rust 1.51.0 clippy issue (upper_case_acronyms) error: name `TYPE_UNKNOWN` contains a capitalized acronym --> vm-virtio/src/lib.rs:48:5 | 48 | TYPE_UNKNOWN = 0xFF, | ^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Type_Unknown` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms error: name `GetDeviceID` contains a capitalized acronym --> block_util/src/lib.rs:138:5 | 138 | GetDeviceID, | ^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `GetDeviceId` | = note: `-D clippy::upper-case-acronyms` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms Signed-off-by: Rob Bradford --- block_util/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block_util/src/lib.rs b/block_util/src/lib.rs index a9d1b0bbc..04e63f008 100644 --- a/block_util/src/lib.rs +++ b/block_util/src/lib.rs @@ -135,7 +135,7 @@ pub enum RequestType { In, Out, Flush, - GetDeviceID, + GetDeviceId, Unsupported(u32), } @@ -148,7 +148,7 @@ pub fn request_type( VIRTIO_BLK_T_IN => Ok(RequestType::In), VIRTIO_BLK_T_OUT => Ok(RequestType::Out), VIRTIO_BLK_T_FLUSH => Ok(RequestType::Flush), - VIRTIO_BLK_T_GET_ID => Ok(RequestType::GetDeviceID), + VIRTIO_BLK_T_GET_ID => Ok(RequestType::GetDeviceId), t => Ok(RequestType::Unsupported(t)), } } @@ -214,7 +214,7 @@ impl Request { if !desc.is_write_only() && req.request_type == RequestType::In { return Err(Error::UnexpectedReadOnlyDescriptor); } - if !desc.is_write_only() && req.request_type == RequestType::GetDeviceID { + if !desc.is_write_only() && req.request_type == RequestType::GetDeviceId { return Err(Error::UnexpectedReadOnlyDescriptor); } req.data_descriptors.push((desc.addr, desc.len)); @@ -280,7 +280,7 @@ impl Request { } } RequestType::Flush => disk.flush().map_err(ExecuteError::Flush)?, - RequestType::GetDeviceID => { + RequestType::GetDeviceId => { if (*data_len as usize) < disk_id.len() { return Err(ExecuteError::BadRequest(Error::InvalidOffset)); } @@ -346,7 +346,7 @@ impl Request { .fsync(Some(user_data)) .map_err(ExecuteError::AsyncFlush)?; } - RequestType::GetDeviceID => { + RequestType::GetDeviceId => { let (data_addr, data_len) = if self.data_descriptors.len() == 1 { (self.data_descriptors[0].0, self.data_descriptors[0].1) } else {