From 0e2430fde169be52a4d724d1d0b751572967febf Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Fri, 21 May 2021 00:48:50 +0800 Subject: [PATCH] clippy: turn on lint upper_case_acronyms cargo-clippy has moved the upper_case_acronyms lint to pedantic(removed from the default list), but we need the lint to keep names consistent and follow the rust naming conventions. Signed-off-by: Tim Zhang --- .clippy.toml | 1 + src/cpu.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .clippy.toml diff --git a/.clippy.toml b/.clippy.toml new file mode 100644 index 0000000..cc94ec5 --- /dev/null +++ b/.clippy.toml @@ -0,0 +1 @@ +upper-case-acronyms-aggressive = true diff --git a/src/cpu.rs b/src/cpu.rs index baaedad..0c7edd9 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -45,7 +45,7 @@ pub struct Cpu { /// The current state of the control group and its processes. #[derive(Debug)] -struct CFSQuotaAndPeriod { +struct CfsQuotaAndPeriod { quota: MaxValue, period: u64, } @@ -284,7 +284,7 @@ impl CpuController { impl CustomizedAttribute for CpuController {} -fn parse_cfs_quota_and_period(mut file: File) -> Result { +fn parse_cfs_quota_and_period(mut file: File) -> Result { let mut content = String::new(); file.read_to_string(&mut content) .map_err(|e| Error::with_cause(ReadFailed, e))?; @@ -299,5 +299,5 @@ fn parse_cfs_quota_and_period(mut file: File) -> Result { .parse::() .map_err(|e| Error::with_cause(ParseError, e))?; - Ok(CFSQuotaAndPeriod { quota, period }) + Ok(CfsQuotaAndPeriod { quota, period }) }