tangled
alpha
login
or
join now
ptr.pet
/
Allegedly
forked from
microcosm.blue/Allegedly
0
fork
atom
Server tools to backfill, tail, mirror, and verify PLC logs
0
fork
atom
overview
issues
pulls
pipelines
refactor apply_op_log to take IntoIterator
ptr.pet
2 weeks ago
5a65e563
7c0e3f6e
verified
This commit was signed with the committer's
known signature
.
ptr.pet
SSH Key Fingerprint:
SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw=
+7
-2
1 changed file
expand all
collapse all
unified
split
src
doc.rs
+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
209
-
pub fn apply_op_log<'a>(did: &'a str, ops: &'a [Value]) -> Option<DocumentData<'a>> {
209
209
+
pub fn apply_op_log<'a>(
210
210
+
did: &'a str,
211
211
+
ops: impl IntoIterator<Item = &'a Value>,
212
212
+
) -> Option<DocumentData<'a>> {
210
213
// TODO: we don't verify signature chain, we should do that...
211
211
-
ops.last().and_then(|op| op_to_doc_data(did, op))
214
214
+
ops.into_iter()
215
215
+
.last()
216
216
+
.and_then(|op| op_to_doc_data(did, op))
212
217
}
213
218
214
219
#[cfg(test)]