Skip to content

Commit

Permalink
Fix test of rule display
Browse files Browse the repository at this point in the history
  • Loading branch information
sorz committed Jan 9, 2024
1 parent bcdf000 commit 4af7237
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/policy/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{fmt::Display, mem};
use flexstr::SharedStr;
use serde::Serialize;

#[derive(Debug, Clone, Eq, PartialEq, Hash, Default, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Hash, Default, Serialize, PartialOrd, Ord)]
pub struct CapSet(Box<[SharedStr]>);

impl CapSet {
Expand Down
3 changes: 2 additions & 1 deletion src/policy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ impl Display for Action {
write!(f, "!")?;
}
if let ActionType::Require(ref caps) = self.action {
let caps = Vec::from_iter(caps);
let mut caps = Vec::from_iter(caps);
caps.sort_unstable();
match caps.first() {
Some(cap) => write!(f, " {}", cap)?,
None => write!(f, " NOTHING")?,
Expand Down

0 comments on commit 4af7237

Please sign in to comment.