fix: some smol fixes

This commit is contained in:
silver 2025-03-10 22:36:26 +00:00
parent c0ba582899
commit 0ed95f3546
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D

View file

@ -12,7 +12,7 @@ async fn main() -> tide::Result<()> {
}
async fn update(config: &Config) -> tide::Result<()> {
let db = db_init(config).await.unwrap();
let db = db_init(config).await?;
// default user to ensure group is never empty
let mut users_tmp = HashSet::from([String::from("compsoc")]);
@ -33,7 +33,7 @@ async fn update(config: &Config) -> tide::Result<()> {
}
// pull from wolves csv
for user in from_csv(&db).await.unwrap_or_default() {
for user in from_wolves(&db).await.unwrap_or_default() {
users_tmp.insert(user);
}
@ -73,7 +73,7 @@ fn get_from_env(users: &mut HashSet<String>, other: &mut HashSet<String>, key: &
}
}
async fn from_csv(db: &Pool<Sqlite>) -> Result<HashSet<String>, Box<dyn Error>> {
async fn from_wolves(db: &Pool<Sqlite>) -> Result<HashSet<String>, Box<dyn Error>> {
let mut uids = HashSet::new();
for record in get_wolves(db).await {