fix: add #[must_use] to unread_count, collect_unread, unread_summary per codebase convention
This commit is contained in:
parent
68e30b857c
commit
0e5bffc9f4
1 changed files with 3 additions and 0 deletions
|
|
@ -349,6 +349,7 @@ pub async fn read_room(client: &Client, room_ref: &str, limit: Option<usize>) ->
|
||||||
/// cached by the matrix-sdk client. Used by the harness to surface
|
/// cached by the matrix-sdk client. Used by the harness to surface
|
||||||
/// unread matrix activity in `get_loose_ends` without exposing
|
/// unread matrix activity in `get_loose_ends` without exposing
|
||||||
/// message content.
|
/// message content.
|
||||||
|
#[must_use]
|
||||||
pub fn unread_count(client: &Client) -> DaemonResponse {
|
pub fn unread_count(client: &Client) -> DaemonResponse {
|
||||||
let rooms = client
|
let rooms = client
|
||||||
.joined_rooms()
|
.joined_rooms()
|
||||||
|
|
@ -363,6 +364,7 @@ pub fn unread_count(client: &Client) -> DaemonResponse {
|
||||||
/// one unread notification the last message body is fetched via the
|
/// one unread notification the last message body is fetched via the
|
||||||
/// `/messages` endpoint (best-effort; failures leave `last_body` as
|
/// `/messages` endpoint (best-effort; failures leave `last_body` as
|
||||||
/// `None`). Rooms with zero unreads are omitted.
|
/// `None`). Rooms with zero unreads are omitted.
|
||||||
|
#[must_use]
|
||||||
pub async fn collect_unread(client: &Client) -> Vec<crate::protocol::RoomUnread> {
|
pub async fn collect_unread(client: &Client) -> Vec<crate::protocol::RoomUnread> {
|
||||||
use crate::protocol::RoomUnread;
|
use crate::protocol::RoomUnread;
|
||||||
let mut result = Vec::new();
|
let mut result = Vec::new();
|
||||||
|
|
@ -423,6 +425,7 @@ async fn fetch_last_message(
|
||||||
/// Return per-room unread summaries. For rooms with exactly one
|
/// Return per-room unread summaries. For rooms with exactly one
|
||||||
/// unread notification, attempts to include the sender + truncated
|
/// unread notification, attempts to include the sender + truncated
|
||||||
/// body; rooms with multiple unreads carry only the count.
|
/// body; rooms with multiple unreads carry only the count.
|
||||||
|
#[must_use]
|
||||||
pub async fn unread_summary(client: &Client) -> DaemonResponse {
|
pub async fn unread_summary(client: &Client) -> DaemonResponse {
|
||||||
let rooms = collect_unread(client).await;
|
let rooms = collect_unread(client).await;
|
||||||
DaemonResponse::ok(&rooms)
|
DaemonResponse::ok(&rooms)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue