chore: fix warnings

This commit is contained in:
Zixuan Chen 2022-08-12 14:41:15 +08:00
parent f7db72d99e
commit c498a3e243
2 changed files with 5 additions and 4 deletions

View file

@ -1,3 +1,4 @@
#![allow(unused)]
mod encoding;
mod loro;
mod raw_change;

View file

@ -40,21 +40,21 @@ impl RawStore {
}
self.calc_hash();
for (_clientId, _mac) in self.macs.as_ref().unwrap().iter() {
for (_client_id, _mac) in self.macs.as_ref().unwrap().iter() {
todo!("pending");
}
true
}
pub fn get_final_hash(&self, clientId: ClientID) -> ChangeHash {
let changes = self.changes.get(&clientId).unwrap();
pub fn get_final_hash(&self, client_id: ClientID) -> ChangeHash {
let changes = self.changes.get(&client_id).unwrap();
let last = changes.vec().last().unwrap();
last.hash.unwrap()
}
fn calc_hash(&mut self) {
for (_client_id, changes) in &mut self.changes {
for (_client_id, changes) in &mut self.changes.iter_mut() {
let changes = changes.vec_mut();
let mut start_index = 0;
for i in (0..changes.len()).rev() {