rename some methods

This commit is contained in:
yggverse 2026-03-27 11:29:51 +02:00
parent f5345e963d
commit 0b08744f8f
2 changed files with 11 additions and 11 deletions

View file

@ -58,7 +58,7 @@ impl Rules {
})
}
/// Get total rules from the current session
pub async fn rules(&self) -> u64 {
pub async fn total(&self) -> u64 {
self.0.read().await.len() as u64
}
/// Allow given `rule`
@ -72,15 +72,15 @@ impl Rules {
Ok(self.0.write().await.remove(&Item::from_line(rule)))
}
/// Return active rules (from server memory)
pub async fn list(&self) -> Vec<String> {
let mut list: Vec<String> = self
pub async fn active(&self) -> Vec<String> {
let mut rules: Vec<String> = self
.0
.read()
.await
.iter()
.map(|item| item.to_string())
.collect();
list.sort(); // HashSet does not keep the order
list
rules.sort(); // HashSet does not keep the order
rules
}
}