From 5f42a12d771ab030f6e9d6f1362a6580cb98d6f5 Mon Sep 17 00:00:00 2001 From: Abdulla Abdurakhmanov Date: Wed, 14 Aug 2024 14:48:27 +0200 Subject: [PATCH] Small bytes to vec optimisation --- src/file_converters/pdf_image_converter.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/file_converters/pdf_image_converter.rs b/src/file_converters/pdf_image_converter.rs index ff60e15..6d45108 100644 --- a/src/file_converters/pdf_image_converter.rs +++ b/src/file_converters/pdf_image_converter.rs @@ -47,9 +47,7 @@ impl PdfToImage for PdfImageConverter { .set_target_width(2000) .set_maximum_height(2000) .rotate_if_landscape(PdfPageRenderRotation::Degrees90, true); - let document = self - .pdfium - .load_pdf_from_byte_vec(pdf_bytes.to_vec(), None)?; + let document = self.pdfium.load_pdf_from_byte_vec(pdf_bytes.into(), None)?; let mut pdf_info = PdfInfo { pages: Vec::new() }; for page in document.pages().iter() { let image = page.render_with_config(&render_config)?.as_image();