Skip to content

Commit

Permalink
refactor: Remove unnecessary Box
Browse files Browse the repository at this point in the history
  • Loading branch information
bcyran committed Mar 1, 2024
1 parent 6d9e22b commit c864a95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/heif/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn validate_file<P: AsRef<Path>>(path: P) -> Result<()> {
}

/// Extract XMP metadata bytes from HEIF image.
pub fn get_xmp_metadata(heif_ctx: &HeifContext) -> Result<Box<[u8]>> {
pub fn get_xmp_metadata(heif_ctx: &HeifContext) -> Result<Vec<u8>> {
let primary_image_handle = heif_ctx.primary_image_handle()?;

let mut metadata_ids: [ItemId; 1] = [0];
Expand All @@ -35,7 +35,7 @@ pub fn get_xmp_metadata(heif_ctx: &HeifContext) -> Result<Box<[u8]>> {
let xmp_metadata = primary_image_handle.metadata(xmp_metadata_id)?;

debug!("XMP metadata read");
Ok(xmp_metadata.into_boxed_slice())
Ok(xmp_metadata)
}

/// Get all available top level image handles from HEIF.
Expand Down

0 comments on commit c864a95

Please sign in to comment.