Add is_empty method to Roles

This commit is contained in:
NicolasCantu 2025-06-06 12:47:55 +02:00 committed by Nicolas Cantu
parent 8a95dbffda
commit 1929153e8c

View File

@ -482,6 +482,10 @@ impl Roles {
Roles(roles) Roles(roles)
} }
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
pub fn to_bytes(&self) -> Result<Vec<u8>> { pub fn to_bytes(&self) -> Result<Vec<u8>> {
serde_json::to_vec(&self.0).map_err(|e| Error::msg(e.to_string())) serde_json::to_vec(&self.0).map_err(|e| Error::msg(e.to_string()))
} }