Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia committed Oct 29, 2024
1 parent e57ab2f commit 6a476bb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::{ImageDecoder, ImageFormat, ImageResult};
pub(crate) trait ReadSeek: Read + Seek {}
impl<T: Read + Seek> ReadSeek for T {}


pub(crate) static DECODING_HOOKS: RwLock<Option<HashMap<ImageFormat, DecodingHook>>> =
RwLock::new(None);

Expand All @@ -38,11 +37,8 @@ impl Seek for GenericReader<'_> {
}

/// A function to produce an `ImageDecoder` for a given image format.
pub type DecodingHook = Box<
dyn for<'a> Fn(GenericReader<'a>) -> ImageResult<Box<dyn ImageDecoder + 'a>>
+ Send
+ Sync,
>;
pub type DecodingHook =
Box<dyn for<'a> Fn(GenericReader<'a>) -> ImageResult<Box<dyn ImageDecoder + 'a>> + Send + Sync>;

/// Register a new decoding hook or replace an existing one.
pub fn register_decoding_hook(format: ImageFormat, hook: DecodingHook) {
Expand Down

0 comments on commit 6a476bb

Please sign in to comment.