diff --git a/src/lib.rs b/src/lib.rs index 9d22bc4..8d84e25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,6 +17,7 @@ #![deny(clippy::if_not_else)] #![deny(clippy::match_same_arms)] #![deny(clippy::missing_panics_doc)] +#![deny(clippy::missing_errors_doc)] #![deny(clippy::missing_fields_in_debug)] #![deny(clippy::must_use_candidate)] #![deny(clippy::or_fun_call)] diff --git a/src/srt.rs b/src/srt.rs index d6bf223..9fbf33f 100644 --- a/src/srt.rs +++ b/src/srt.rs @@ -4,6 +4,9 @@ use std::io; use crate::time::TimeSpan; /// Write subtitles in srt format +/// # Errors +/// +/// Will return `Err` if write in `writer` return an `Err`. pub fn write_srt( data: &[(TimeSpan, String)], writer: &mut impl io::Write, diff --git a/src/vobsub/palette.rs b/src/vobsub/palette.rs index f5e0bbf..381253c 100644 --- a/src/vobsub/palette.rs +++ b/src/vobsub/palette.rs @@ -34,6 +34,9 @@ fn hex_rgb(input: &[u8]) -> IResult<&[u8], Rgb> { pub type Palette = [Rgb; 16]; /// Parse a text as Palette +/// # Errors +/// +/// Will return `Err` if the input don't have 16 entries. pub fn palette(input: &[u8]) -> IResult<&[u8], Palette> { let res = map_res(separated_list0(tag(b", "), hex_rgb), |vec: Vec>| { if vec.len() != 16 { diff --git a/src/vobsub/probe.rs b/src/vobsub/probe.rs index fee0328..887069e 100644 --- a/src/vobsub/probe.rs +++ b/src/vobsub/probe.rs @@ -21,6 +21,9 @@ fn has_magic(path: &Path, magic: &[u8]) -> Result { } /// Does the specified path appear to point to an `*.idx` file? +/// # Errors +/// +/// Will return `Err` if the file can't be read. pub fn is_idx_file>(path: P) -> Result { has_magic(path.as_ref(), b"# VobSub index file") } @@ -29,6 +32,10 @@ pub fn is_idx_file>(path: P) -> Result { /// /// Note that this may (or may not) return false positives for certain /// MPEG-2 related formats. +/// +/// # Errors +/// +/// Will return `Err` if the file can't be read. pub fn is_sub_file>(path: P) -> Result { has_magic(path.as_ref(), &[0x00, 0x00, 0x01, 0xba]) }