mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
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:
1
.clippy.toml
Normal file
1
.clippy.toml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
upper-case-acronyms-aggressive = true
|
||||||
@@ -45,7 +45,7 @@ pub struct Cpu {
|
|||||||
|
|
||||||
/// The current state of the control group and its processes.
|
/// The current state of the control group and its processes.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct CFSQuotaAndPeriod {
|
struct CfsQuotaAndPeriod {
|
||||||
quota: MaxValue,
|
quota: MaxValue,
|
||||||
period: u64,
|
period: u64,
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ impl CpuController {
|
|||||||
|
|
||||||
impl CustomizedAttribute for 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();
|
let mut content = String::new();
|
||||||
file.read_to_string(&mut content)
|
file.read_to_string(&mut content)
|
||||||
.map_err(|e| Error::with_cause(ReadFailed, e))?;
|
.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>()
|
.parse::<u64>()
|
||||||
.map_err(|e| Error::with_cause(ParseError, e))?;
|
.map_err(|e| Error::with_cause(ParseError, e))?;
|
||||||
|
|
||||||
Ok(CFSQuotaAndPeriod { quota, period })
|
Ok(CfsQuotaAndPeriod { quota, period })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user