Skip to content

Commit

Permalink
Change helper name and wording to available/unavailable
Browse files Browse the repository at this point in the history
Signed-off-by: Uchio Kondo <[email protected]>
  • Loading branch information
udzura committed Dec 7, 2022
1 parent dee7190 commit 01a492e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/youki/src/commands/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ pub fn print_namespaces() {
}

#[inline]
fn get_cap_supported(caps: &caps::CapsHashSet, cap: caps::Capability) -> &'static str {
fn is_cap_available(caps: &caps::CapsHashSet, cap: caps::Capability) -> &'static str {
if caps.contains(&cap) {
"available"
} else {
"unsupported"
"unavailable"
}
}

Expand All @@ -239,17 +239,17 @@ pub fn print_capabilities() {
println!(
"{:<17} {}",
"CAP_BPF",
get_cap_supported(&current, caps::Capability::CAP_BPF)
is_cap_available(&current, caps::Capability::CAP_BPF)
);
println!(
"{:<17} {}",
"CAP_PERFMON",
get_cap_supported(&current, caps::Capability::CAP_PERFMON)
is_cap_available(&current, caps::Capability::CAP_PERFMON)
);
println!(
"{:<17} {}",
"CAP_CHECKPOINT_RESTORE",
get_cap_supported(&current, caps::Capability::CAP_CHECKPOINT_RESTORE)
is_cap_available(&current, caps::Capability::CAP_CHECKPOINT_RESTORE)
);
} else {
println!("<cannot find cap info>");
Expand Down

0 comments on commit 01a492e

Please sign in to comment.