diff options
Diffstat (limited to 'src/document/passing.rs')
| -rw-r--r-- | src/document/passing.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/document/passing.rs b/src/document/passing.rs index f745d42..10b888d 100644 --- a/src/document/passing.rs +++ b/src/document/passing.rs @@ -232,7 +232,7 @@ pub(crate) struct Taken { /// It carried changes, all of them refused before (`screen::Outcome`). pub(crate) refused_again: bool, /// The changes that broke a rule, of those refused. - pub(crate) roots: Vec<ChangeHash>, + pub(crate) roots: Vec<super::UnitId>, /// Changes it carried forged under another node's actor. pub(crate) forged: usize, /// The fresh actor this node writes as from now on, where it carried a change of @@ -280,7 +280,7 @@ pub(crate) fn take( heads_before, said, refused_again: outcome.refused_again, - roots: outcome.roots, + roots: outcome.roots.into_iter().map(Into::into).collect(), forged: outcome.forged, fresh_actor: outcome.fresh_actor, }; @@ -305,7 +305,7 @@ pub(crate) struct Settled { /// predecessors (the peer's heads aren't the document's yet), or had come before. pub(crate) waits: Option<bool>, /// Whose the changes it brought are, whether any is nobody's, and when each was made. - pub(crate) authors: Vec<(String, Vec<ChangeHash>)>, + pub(crate) authors: Vec<(String, Vec<super::UnitId>)>, pub(crate) unauthored: bool, pub(crate) times: Vec<i64>, /// Where asked: whether the document holds all the peer said it has. @@ -354,7 +354,15 @@ pub(crate) fn settle( let waits = (carried && !changed).then(|| !super::changes::holds_all(&replica.doc, &taken.said)); let (authors, unauthored, times) = match since { - Some(since) => (since.authors, since.unauthored, since.times), + Some(since) => ( + since + .authors + .into_iter() + .map(|(author, hashes)| (author, hashes.into_iter().map(Into::into).collect())) + .collect(), + since.unauthored, + since.times, + ), None => (Vec::new(), false, Vec::new()), }; Settled { |
