fix: Resolve unnecessary serialization issue

Fixes #1335
This commit is contained in:
April Grimoire 2026-02-06 14:43:02 +08:00 committed by aprilgrimoire
parent 00c054d356
commit 296a4b92d6
2 changed files with 6 additions and 1 deletions

1
changelog.d/1340.bugfix Normal file
View file

@ -0,0 +1 @@
Use exists instead of contains to save writing to a buffer in src/service/users/mod.rs: is_login_disabled. Contributed by @aprilgrimoire.

View file

@ -304,7 +304,11 @@ impl Service {
pub fn enable_login(&self, user_id: &UserId) { self.db.userid_logindisabled.remove(user_id); }
pub async fn is_login_disabled(&self, user_id: &UserId) -> bool {
self.db.userid_logindisabled.contains(user_id).await
self.db
.userid_logindisabled
.exists(user_id.as_str())
.await
.is_ok()
}
/// Check if account is active, infallible