fix(#1375): clean up pedantic warnings and re-enable -D warnings without pedantic bypass

This commit is contained in:
damocles 2026-06-05 15:59:45 +02:00 committed by mara
commit fb726197ea
28 changed files with 109 additions and 90 deletions

View file

@ -46,6 +46,12 @@ struct WhoamiResponse {
/// session to call whoami).
/// 3. Build the real Client with the sqlite store + `restore_session`
/// using a synthetic `MatrixSession`.
///
/// # Errors
///
/// Returns an error if the token file is missing or empty, if the
/// `whoami` request fails, or if the matrix-sdk client fails to build
/// or restore the session.
pub async fn build_and_restore(
homeserver: &str,
token_file: &Path,

View file

@ -33,6 +33,11 @@ pub const WAKE_BODY_TRUNCATE: usize = 100;
/// `#[serde(tag = "cmd", rename_all = "snake_case")]`. Must be `"cmd"`,
/// not `"kind"` — the harness deserialises against the hive-sh4re type
/// and silently discards requests that don't match.
///
/// # Errors
///
/// Returns an error on socket connect failure, serialisation failure,
/// or I/O error writing to or reading from the socket.
pub async fn send_wake(socket: &Path, body: impl AsRef<str>) -> Result<()> {
use tokio::io::AsyncBufReadExt;
@ -117,6 +122,7 @@ pub fn format_unread_summary(rooms: &[crate::protocol::RoomUnread]) -> String {
/// Truncate `s` to `max` Unicode chars, appending `…` when cut.
/// Char-based not byte-based so multi-byte content (most chat) doesn't
/// get cut mid-codepoint.
#[must_use]
pub fn truncate_chars(s: &str, max: usize) -> String {
let mut end = s.len();
for (count, (i, _)) in s.char_indices().enumerate() {