From 5a65e563e422ff93e071cfc0c49e88961555a031 Mon Sep 17 00:00:00 2001 From: dawn <90008@gaze.systems> Date: Sat, 21 Feb 2026 02:59:17 +0300 Subject: [PATCH] refactor apply_op_log to take IntoIterator --- src/doc.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/doc.rs b/src/doc.rs index 091c2c7..23e0895 100644 --- a/src/doc.rs +++ b/src/doc.rs @@ -206,9 +206,14 @@ pub fn op_to_doc_data<'a>(did: &'a str, op: &'a Value) -> Option(did: &'a str, ops: &'a [Value]) -> Option> { +pub fn apply_op_log<'a>( + did: &'a str, + ops: impl IntoIterator, +) -> Option> { // TODO: we don't verify signature chain, we should do that... - ops.last().and_then(|op| op_to_doc_data(did, op)) + ops.into_iter() + .last() + .and_then(|op| op_to_doc_data(did, op)) } #[cfg(test)] -- 2.51.2