Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Commit

Permalink
Fix clippy lints for rust 1.66 (#1676)
Browse files Browse the repository at this point in the history
Co-authored-by: crapStone <crapstone01@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1676
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: crapStone <crapstone@noreply.codeberg.org>
Co-committed-by: crapStone <crapstone@noreply.codeberg.org>
  • Loading branch information
2 people authored and 6543 committed Dec 21, 2022
1 parent b8cf561 commit 5907b0c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/load_save/src/pdf/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ pub fn merge_pdfs(documents: Vec<Document>) -> Result<Document> {
documents_pages.extend(
document
.get_pages()
.into_iter()
.map(|(_, object_id)| (object_id, document.get_object(object_id).unwrap().to_owned()))
.into_values()
.map(|object_id| (object_id, document.get_object(object_id).unwrap().to_owned()))
.collect::<BTreeMap<ObjectId, Object>>(),
);
documents_objects.extend(document.objects);
Expand Down Expand Up @@ -116,10 +116,7 @@ pub fn merge_pdfs(documents: Vec<Document>) -> Result<Document> {
// Set new "Kids" list (collected from documents pages) for "Pages"
dictionary.set(
"Kids",
documents_pages
.into_iter()
.map(|(object_id, _)| Object::Reference(object_id))
.collect::<Vec<_>>(),
documents_pages.into_keys().map(Object::Reference).collect::<Vec<_>>(),
);

document.objects.insert(pages_object.0, Object::Dictionary(dictionary));
Expand Down

0 comments on commit 5907b0c

Please sign in to comment.