improve appservice::Data interface encap

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-29 01:19:23 +00:00
parent 30b5ad3870
commit 0f1432f448
4 changed files with 20 additions and 18 deletions

View file

@ -51,17 +51,4 @@ impl Data {
.map_err(|_| Error::bad_database("Invalid id bytes in id_appserviceregistrations."))
})))
}
pub fn all(&self) -> Result<Vec<(String, Registration)>> {
self.iter_ids()?
.filter_map(Result::ok)
.map(move |id| {
Ok((
id.clone(),
self.get_registration(&id)?
.expect("iter_ids only returns appservices that exist"),
))
})
.collect()
}
}