Fix clippy for rust 1.53

There are new lints are added in clippy for rust 1.53

Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
Tim Zhang
2021-06-30 19:05:38 +08:00
parent 45b626e0c0
commit ec4cda1dd9
6 changed files with 16 additions and 13 deletions

View File

@@ -49,6 +49,7 @@ impl Default for DeviceType {
impl DeviceType {
/// Convert a DeviceType into the character that the kernel recognizes.
#[allow(clippy::should_implement_trait, clippy::wrong_self_convention)]
pub fn to_char(&self) -> char {
match self {
DeviceType::All => 'a',
@@ -82,6 +83,7 @@ pub enum DevicePermissions {
impl DevicePermissions {
/// Convert a DevicePermissions into the character that the kernel recognizes.
#[allow(clippy::should_implement_trait, clippy::wrong_self_convention)]
pub fn to_char(&self) -> char {
match self {
DevicePermissions::Read => 'r',

View File

@@ -738,6 +738,7 @@ impl Default for MaxValue {
}
impl MaxValue {
#[allow(clippy::should_implement_trait, clippy::wrong_self_convention)]
fn to_i64(&self) -> i64 {
match self {
MaxValue::Max => -1,