Server tools to backfill, tail, mirror, and verify PLC logs

refactor apply_op_log to take IntoIterator

ptr.pet 5a65e563 7c0e3f6e

verified
+7 -2
+7 -2
src/doc.rs
··· 206 206 207 207 /// apply a sequence of operation JSON blobs and return the current document data. 208 208 /// returns None if the DID is tombstoned (last op is a tombstone). 209 - pub fn apply_op_log<'a>(did: &'a str, ops: &'a [Value]) -> Option<DocumentData<'a>> { 209 + pub fn apply_op_log<'a>( 210 + did: &'a str, 211 + ops: impl IntoIterator<Item = &'a Value>, 212 + ) -> Option<DocumentData<'a>> { 210 213 // TODO: we don't verify signature chain, we should do that... 211 - ops.last().and_then(|op| op_to_doc_data(did, op)) 214 + ops.into_iter() 215 + .last() 216 + .and_then(|op| op_to_doc_data(did, op)) 212 217 } 213 218 214 219 #[cfg(test)]