From f0cd96e90bf696099b02201ac68f9ccb8a00c7d2 Mon Sep 17 00:00:00 2001 From: Oliver Hagmann <268387159+ohagmann@users.noreply.github.com> Date: Thu, 29 Oct 2026 05:54:15 +0100 Subject: [PATCH] Review: isolate_annotations says that an index off the page's list is an error Co-Authored-By: Claude Opus 5.5 --- crates/annot/src/lookup.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/annot/src/lookup.rs b/crates/annot/src/lookup.rs index 50097a5e9f..c7a0fd9831 100644 --- a/crates/annot/src/lookup.rs +++ b/crates/annot/src/lookup.rs @@ -231,6 +231,8 @@ pub fn isolate_annotation(doc: &mut Document, page: usize, index: usize) -> Resu /// [`isolate_annotation`] for several annotations of one page: those of them with a normal /// appearance stay, in their order on the page. `false`, with `doc` unchanged, when none has one. +/// An index that isn't one of the page's annotations is an error even when the others are, and +/// leaves `doc` unchanged too. pub fn isolate_annotations(doc: &mut Document, page: usize, indices: &[usize]) -> Result { let p = page_ref(doc, page)?; let list = annots(doc, p);