diff --git a/tasky/src/models/group.rs b/tasky/src/models/group.rs index 6e6a333..edbd084 100644 --- a/tasky/src/models/group.rs +++ b/tasky/src/models/group.rs @@ -115,14 +115,14 @@ impl GroupRepository { .order(dsl::verified.desc()) .paginate(page) .load_and_count_pages::(conn); - if result.is_err() { + if let Ok(model) = result { + model + } else { PaginatedModel { results: vec![], total: 0, page, } - } else { - result.unwrap() } }