cargo clippy fix

This commit is contained in:
2026-09-17 18:57:35 +01:00
parent 21a20b898c
commit a9bd890d16
4 changed files with 13 additions and 15 deletions
+4 -4
View File
@@ -51,20 +51,20 @@ impl Model {
.await
}
pub async fn get_all_active_sessions(db: &DatabaseConnection) -> Result<Vec<Model>, DbErr> {
Ok(Entity::find()
Entity::find()
.filter(Column::EndedAt.is_null())
.all(db)
.await?)
.await
}
pub async fn get_active_by_stream_key_id(
db: &DatabaseConnection,
stream_key_id: i32,
) -> Result<Option<Model>, DbErr> {
Ok(Entity::find()
Entity::find()
.filter(Column::StreamKeyId.eq(stream_key_id))
.filter(Column::EndedAt.is_null())
.one(db)
.await?)
.await
}
pub async fn clean_unended_streams(db: &DatabaseConnection) -> Result<u64, DbErr> {
+4 -4
View File
@@ -58,18 +58,18 @@ impl Entity {
if let Some(x) = sessions {
Entity::find_by_id(x.id_user).one(db).await
} else {
return Ok(None);
Ok(None)
}
}
pub async fn find_by_username(
db: &DatabaseConnection,
username: String,
) -> Result<Option<Model>, DbErr> {
let user = Entity::find()
Entity::find()
.filter(Column::Username.eq(username))
.one(db)
.await;
user
.await
}
}