Skip to content

Commit

Permalink
docs: some typo fixes and backticks added
Browse files Browse the repository at this point in the history
this reduce the number of errors reported by spellcheck
  • Loading branch information
gwen-lg committed Jul 18, 2024
1 parent 8413bf2 commit 674f897
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/srt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::io;

use crate::time::TimeSpan;

/// Write subtitles in srt format
/// Write subtitles in `srt` format
/// # Errors
///
/// Will return `Err` if write in `writer` return an `Err`.
Expand All @@ -19,7 +19,7 @@ pub fn write_srt(
Ok(())
}

/// Write an subtitle line in Srt format
/// Write an subtitle line in `srt` format
fn write_srt_line(
writer: &mut impl io::Write,
) -> impl FnMut((usize, &(TimeSpan, String))) -> Result<(), io::Error> + '_ {
Expand Down
2 changes: 1 addition & 1 deletion src/time/time_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::ops::Neg;
pub struct TimePoint(i64);

impl TimePoint {
/// Create a `TimePoint` from miliseconds
/// Create a `TimePoint` from milliseconds
#[must_use]
pub const fn from_msecs(time: i64) -> Self {
Self(time)
Expand Down
2 changes: 1 addition & 1 deletion src/vobsub/img.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub enum Error {
#[error("Scan line is longer than image width: [{x},{width}]")]
ScanLineLongerThanWidth { x: usize, width: usize },

/// Forward scan line parsind error.
/// Forward scan line parsing error.
#[error("Parsing scan line failed")]
ScanLineParsing(#[source] NomError),
}
Expand Down
10 changes: 5 additions & 5 deletions src/vobsub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub enum VobSubError {
#[error("PES packet parsing.")]
PESPacket(#[source] NomError),

/// If the `control packet` is incmplete
/// If the `control packet` is incomplete
#[error("Incomplete control packet")]
IncompleteControlPacket,

Expand Down Expand Up @@ -183,11 +183,11 @@ pub enum NomError {
#[error("Incomplete input: '{0:?}' needed.")]
IncompleteInput(Needed),

/// An error happend during parsing
/// An Error occurred during parsing
#[error("Error from nom : {0}")]
Error(String),

/// And Failure happend during parsing
/// An Failure occurred during parsing
#[error("Failure from nom : {0}")]
Failure(String),
}
Expand All @@ -196,12 +196,12 @@ pub enum NomError {
pub trait IResultExt<I, O, E> {
/// Convert an `IResult` to Result<_, `NomError`> and check than the buffer is empty after parsing.
/// # Errors
/// Forward `Error` and `Failure` from nom, and return `UnexpectedInput` if the buffer is not empty after parsing.
/// Forward `Error` and `Failure` from `nom`, and return `UnexpectedInput` if the buffer is not empty after parsing.
fn to_result_no_rest(self) -> Result<O, NomError>;

/// Convert an `IResult` to Result<_, `NomError`>
/// # Errors
/// Forward `Error` and `Failure` from nom.
/// Forward `Error` and `Failure` from `nom`.
fn to_result(self) -> Result<(I, O), NomError>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/vobsub/palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn hex_rgb(input: &[u8]) -> IResult<&[u8], Rgb<u8>> {
Ok((input, Rgb([red, green, blue])))
}

/// The 16-color pallette used by the subtitles.
/// The 16-color palette used by the subtitles.
pub type Palette = [Rgb<u8>; 16];

/// Parse a text as Palette
Expand Down

0 comments on commit 674f897

Please sign in to comment.