From e219edd4fe53b7f7e948c9a3f29f093ce1e5c02f Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 12 Feb 2026 06:59:47 -0800 Subject: [PATCH 1/2] Remove some unused errors. --- rs/hang/src/error.rs | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/rs/hang/src/error.rs b/rs/hang/src/error.rs index c6aecc4e0..de3e0ce6d 100644 --- a/rs/hang/src/error.rs +++ b/rs/hang/src/error.rs @@ -14,34 +14,10 @@ pub enum Error { #[error("json error: {0}")] Json(Arc), - /// Attempted to add a track that already exists in the catalog. - #[error("duplicate track")] - DuplicateTrack, - - /// Referenced track was not found in the catalog. - #[error("missing track")] - MissingTrack, - - /// The provided session ID is invalid or malformed. - #[error("invalid session ID")] - InvalidSession, - - /// Attempted to process an empty group (no frames). - #[error("empty group")] - EmptyGroup, - /// The specified codec is invalid or malformed. #[error("invalid codec")] InvalidCodec, - /// The frame data is invalid or corrupted. - #[error("invalid frame")] - InvalidFrame, - - /// The codec is not supported by this implementation. - #[error("unsupported codec")] - UnsupportedCodec, - /// Failed to parse an integer value. #[error("expected int")] ExpectedInt(#[from] std::num::ParseIntError), @@ -66,6 +42,7 @@ pub enum Error { #[error("url parse error: {0}")] Url(#[from] url::ParseError), + /// The format is not recognized. #[error("unknown format: {0}")] UnknownFormat(String), } From 7d38199eb7e55f3d815269ceb63416670b8bdfad Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 12 Feb 2026 07:02:39 -0800 Subject: [PATCH 2/2] Add non_exhaustive to some more error types. --- rs/hang/src/error.rs | 1 + rs/libmoq/src/error.rs | 1 + rs/moq-lite/src/coding/decode.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/rs/hang/src/error.rs b/rs/hang/src/error.rs index de3e0ce6d..37d2d601e 100644 --- a/rs/hang/src/error.rs +++ b/rs/hang/src/error.rs @@ -5,6 +5,7 @@ use std::sync::Arc; /// This enum represents all possible errors that can occur when working with /// hang media streams, codecs, and containers. #[derive(Debug, thiserror::Error, Clone)] +#[non_exhaustive] pub enum Error { /// An error from the underlying MoQ transport layer. #[error("moq lite error: {0}")] diff --git a/rs/libmoq/src/error.rs b/rs/libmoq/src/error.rs index cfb5d4315..a9675a42e 100644 --- a/rs/libmoq/src/error.rs +++ b/rs/libmoq/src/error.rs @@ -13,6 +13,7 @@ pub type Status = i32; /// Each error variant maps to a specific negative error code /// returned to C callers. #[derive(Debug, thiserror::Error, Clone)] +#[non_exhaustive] pub enum Error { /// Resource was closed. #[error("closed")] diff --git a/rs/moq-lite/src/coding/decode.rs b/rs/moq-lite/src/coding/decode.rs index 8cf3a309b..8467380fa 100644 --- a/rs/moq-lite/src/coding/decode.rs +++ b/rs/moq-lite/src/coding/decode.rs @@ -11,6 +11,7 @@ pub trait Decode: Sized { /// A decode error. #[derive(Error, Debug, Clone)] +#[non_exhaustive] pub enum DecodeError { #[error("short buffer")] Short,