diff --git a/src/vobsub/idx.rs b/src/vobsub/idx.rs index 01bafca..6312c9a 100644 --- a/src/vobsub/idx.rs +++ b/src/vobsub/idx.rs @@ -3,11 +3,11 @@ use log::trace; use once_cell::sync::Lazy; use regex::Regex; -use std::fs; -use std::io; -use std::io::prelude::*; -use std::io::BufReader; -use std::path::Path; +use std::{ + fs, + io::{self, prelude::*, BufReader}, + path::Path, +}; use super::{palette, sub, IResultExt, Palette, VobSubError}; diff --git a/src/vobsub/mod.rs b/src/vobsub/mod.rs index 539b876..24c4a48 100644 --- a/src/vobsub/mod.rs +++ b/src/vobsub/mod.rs @@ -67,10 +67,12 @@ mod palette; mod probe; mod sub; -pub use self::idx::{read_palette, Index}; -pub use self::palette::{palette, Palette}; -pub use self::probe::{is_idx_file, is_sub_file}; -pub use self::sub::{subtitles, ErrorMissing, Subtitle, Subtitles}; +pub use self::{ + idx::{read_palette, Index}, + palette::{palette, Palette}, + probe::{is_idx_file, is_sub_file}, + sub::{subtitles, ErrorMissing, Subtitle, Subtitles}, +}; use crate::content::ContentError; use nom::{IResult, Needed}; diff --git a/src/vobsub/mpeg2/clock.rs b/src/vobsub/mpeg2/clock.rs index 67298d7..1f0a32a 100644 --- a/src/vobsub/mpeg2/clock.rs +++ b/src/vobsub/mpeg2/clock.rs @@ -1,10 +1,9 @@ -use std::fmt; - use nom::{ bits::complete::{tag, take}, sequence::Tuple, IResult, }; +use std::fmt; /// This represents the 90kHz, 33-bit [System Time Clock][STC] (STC) and /// the 9-bit STC extension value, which represents 1/300th of a tick. diff --git a/src/vobsub/mpeg2/ps.rs b/src/vobsub/mpeg2/ps.rs index 9a62481..3413b8d 100644 --- a/src/vobsub/mpeg2/ps.rs +++ b/src/vobsub/mpeg2/ps.rs @@ -14,11 +14,12 @@ use nom::{ }; use std::fmt; +use super::{ + clock::{clock_and_ext, Clock}, + pes, +}; use crate::vobsub::{NomError, VobSubError}; -use super::clock::{clock_and_ext, Clock}; -use super::pes; - /// A parsed [MPEG-2 Program Stream header][MPEG-PS] (MPEG-PS). /// /// [MPEG-PS]: https://en.wikipedia.org/wiki/MPEG_program_stream diff --git a/src/vobsub/probe.rs b/src/vobsub/probe.rs index 522b1ec..e6cb4e6 100644 --- a/src/vobsub/probe.rs +++ b/src/vobsub/probe.rs @@ -1,9 +1,7 @@ //! Try to guess the types of files on disk. use super::VobSubError; -use std::fs; -use std::io::Read; -use std::path::Path; +use std::{fs, io::Read, path::Path}; /// Internal helper function which looks for "magic" bytes at the start of /// a file. diff --git a/src/vobsub/sub.rs b/src/vobsub/sub.rs index 3525dee..6e0bfc6 100644 --- a/src/vobsub/sub.rs +++ b/src/vobsub/sub.rs @@ -5,6 +5,7 @@ //! [subs]: http://sam.zoy.org/writings/dvd/subtitles/ use cast; +use image::{ImageBuffer, Rgba, RgbaImage}; use log::{trace, warn}; use nom::{ bits::{bits, complete::take as take_bits}, @@ -18,17 +19,14 @@ use nom::{ IResult, }; use std::{cmp::Ordering, fmt}; +use thiserror::Error; -use super::mpeg2::ps; -use super::Palette; -use super::{img::decompress, VobSubError}; +use super::{img::decompress, mpeg2::ps, Palette, VobSubError}; use crate::{ content::{Area, AreaValues}, util::BytesFormatter, vobsub::IResultExt, }; -use image::{ImageBuffer, Rgba, RgbaImage}; -use thiserror::Error; /// The default time between two adjacent subtitles if no end time is /// provided. This is chosen to be a value that's usually representable in