Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Furisto committed Sep 9, 2021
1 parent ed8da9a commit 0b124b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cgroups/src/v2/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ impl Memory {
// -1 means max
if swap == -1 || limit == -1 {
Memory::set(path.join(CGROUP_MEMORY_SWAP), swap)?;
Memory::set(path.join(CGROUP_MEMORY_MAX), limit)?;
} else {
if swap < limit {
bail!(
Expand All @@ -114,9 +113,9 @@ impl Memory {
// a separate value, so the swap value in the runtime spec needs
// to be converted from the cgroup v1 value to the cgroup v2 value
// by subtracting limit from swap
Memory::set(path.join(CGROUP_MEMORY_SWAP), swap - limit)?;
Memory::set(path.join(CGROUP_MEMORY_MAX), limit)?;
Memory::set(path.join(CGROUP_MEMORY_SWAP), swap - limit)?;
}
Memory::set(path.join(CGROUP_MEMORY_MAX), limit)?;
}
None => {
if limit == -1 {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn print_cgroups() {
}

if let Some(config) = read_kernel_config() {
let display = FeatureDisplay::with_status("device", "attached", "detached");
let display = FeatureDisplay::with_status("devices", "attached", "detached");
print_feature_status(&config, "CONFIG_CGROUP_BPF", display);
}
}
Expand Down

0 comments on commit 0b124b0

Please sign in to comment.