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 <tim@hyper.sh>
This commit is contained in:
Tim Zhang
2021-05-21 00:48:50 +08:00
parent 5aa7e6c90e
commit 0e2430fde1
2 changed files with 4 additions and 3 deletions

1
.clippy.toml Normal file
View File

@@ -0,0 +1 @@
upper-case-acronyms-aggressive = true

View File

@@ -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<CFSQuotaAndPeriod> {
fn parse_cfs_quota_and_period(mut file: File) -> Result<CfsQuotaAndPeriod> {
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<CFSQuotaAndPeriod> {
.parse::<u64>()
.map_err(|e| Error::with_cause(ParseError, e))?;
Ok(CFSQuotaAndPeriod { quota, period })
Ok(CfsQuotaAndPeriod { quota, period })
}