Remove redundant `apply_one` function
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
0b3a32627b
commit
24f1de980e
|
|
@ -228,13 +228,6 @@ impl Patch {
|
||||||
/// Apply a list of operations to the state.
|
/// Apply a list of operations to the state.
|
||||||
pub fn apply(&mut self, ops: impl IntoIterator<Item = Op>) -> Result<(), ApplyError> {
|
pub fn apply(&mut self, ops: impl IntoIterator<Item = Op>) -> Result<(), ApplyError> {
|
||||||
for op in ops {
|
for op in ops {
|
||||||
self.apply_one(op)?;
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Apply a single op to the state.
|
|
||||||
pub fn apply_one(&mut self, op: Op) -> Result<(), ApplyError> {
|
|
||||||
let id = op.id();
|
let id = op.id();
|
||||||
let author = Author::new(op.author);
|
let author = Author::new(op.author);
|
||||||
let timestamp = op.timestamp;
|
let timestamp = op.timestamp;
|
||||||
|
|
@ -315,6 +308,7 @@ impl Patch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue