From 9770fb50f35c871c857b37ab3bdafb21bb92a33c Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Wed, 26 Oct 2022 18:40:08 +0800 Subject: [PATCH] chore: cargo fix --- .../src/container/text/tracker/cursor_map.rs | 2 +- .../src/container/text/tracker/effects_iter.rs | 1 - crates/loro-core/src/dag.rs | 2 +- crates/loro-core/src/op.rs | 4 ++-- crates/loro-core/src/op/op_content.rs | 4 ++-- crates/rle/src/rle_impl.rs | 2 +- crates/rle/src/rle_tree/node/leaf_impl.rs | 14 +++++++------- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/crates/loro-core/src/container/text/tracker/cursor_map.rs b/crates/loro-core/src/container/text/tracker/cursor_map.rs index 89eb3d9c..caf29ddc 100644 --- a/crates/loro-core/src/container/text/tracker/cursor_map.rs +++ b/crates/loro-core/src/container/text/tracker/cursor_map.rs @@ -9,7 +9,7 @@ use enum_as_inner::EnumAsInner; use rle::{ range_map::RangeMap, rle_tree::{node::LeafNode, Position, SafeCursor, SafeCursorMut, UnsafeCursor}, - HasLength, Mergable, RleVec, RleVecWithIndex, RleVecWithLen, Sliceable, ZeroElement, + HasLength, Mergable, RleVecWithLen, Sliceable, ZeroElement, }; use crate::{ diff --git a/crates/loro-core/src/container/text/tracker/effects_iter.rs b/crates/loro-core/src/container/text/tracker/effects_iter.rs index 3840d0f6..542cbc24 100644 --- a/crates/loro-core/src/container/text/tracker/effects_iter.rs +++ b/crates/loro-core/src/container/text/tracker/effects_iter.rs @@ -2,7 +2,6 @@ use rle::HasLength; use crate::{ container::text::text_content::ListSlice, - debug_log, id::{Counter, ID}, span::{CounterSpan, HasId, HasIdSpan, IdSpan}, version::IdSpanVector, diff --git a/crates/loro-core/src/dag.rs b/crates/loro-core/src/dag.rs index aa069578..dc99bd49 100644 --- a/crates/loro-core/src/dag.rs +++ b/crates/loro-core/src/dag.rs @@ -14,7 +14,7 @@ use std::{ use colored::Colorize; use fxhash::{FxHashMap, FxHashSet}; -use rle::{rle_tree::node::Node, HasLength, Sliceable}; +use rle::{HasLength, Sliceable}; use smallvec::SmallVec; mod iter; mod mermaid; diff --git a/crates/loro-core/src/op.rs b/crates/loro-core/src/op.rs index 0292a322..35509c64 100644 --- a/crates/loro-core/src/op.rs +++ b/crates/loro-core/src/op.rs @@ -2,9 +2,9 @@ use crate::{ change::{Lamport, Timestamp}, container::ContainerID, id::{Counter, ID}, - span::{HasId, IdSpan}, + span::{HasId}, }; -use rle::{HasIndex, HasLength, Mergable, RleVecWithIndex, Sliceable}; +use rle::{HasIndex, HasLength, Mergable, Sliceable}; mod insert_content; mod op_content; diff --git a/crates/loro-core/src/op/op_content.rs b/crates/loro-core/src/op/op_content.rs index c1c50bed..90e20809 100644 --- a/crates/loro-core/src/op/op_content.rs +++ b/crates/loro-core/src/op/op_content.rs @@ -40,10 +40,10 @@ impl Clone for OpContent { content: content.clone(), }, OpContent::Undo { target } => OpContent::Undo { - target: target.clone(), + target: *target, }, OpContent::Redo { target } => OpContent::Redo { - target: target.clone(), + target: *target, }, } } diff --git a/crates/rle/src/rle_impl.rs b/crates/rle/src/rle_impl.rs index 011b372b..5dbd82d4 100644 --- a/crates/rle/src/rle_impl.rs +++ b/crates/rle/src/rle_impl.rs @@ -1,7 +1,7 @@ use std::ops::Range; use crate::{rle_trait::GlobalIndex, HasIndex, HasLength, Mergable, Sliceable}; -use num::{cast, Integer, Num, NumCast}; +use num::{cast, Integer, NumCast}; use smallvec::{Array, SmallVec}; impl Sliceable for bool { diff --git a/crates/rle/src/rle_tree/node/leaf_impl.rs b/crates/rle/src/rle_tree/node/leaf_impl.rs index b566dc23..a18eb4eb 100644 --- a/crates/rle/src/rle_tree/node/leaf_impl.rs +++ b/crates/rle/src/rle_tree/node/leaf_impl.rs @@ -617,7 +617,7 @@ impl<'bump, T: Rle, A: RleTreeTrait> LeafNode<'bump, T, A> { notify(&b, next_leaf); next_leaf.children.insert( child_index - self.children.len() + 2, - (BumpBox::new_in(b, self.bump)), + BumpBox::new_in(b, self.bump), ); } @@ -626,9 +626,9 @@ impl<'bump, T: Rle, A: RleTreeTrait> LeafNode<'bump, T, A> { notify(&b, self); notify(&value, self); self.children - .insert(child_index + 1, (BumpBox::new_in(b, self.bump))); + .insert(child_index + 1, BumpBox::new_in(b, self.bump)); self.children - .insert(child_index + 1, (BumpBox::new_in(value, self.bump))); + .insert(child_index + 1, BumpBox::new_in(value, self.bump)); Ok(()) } @@ -693,7 +693,7 @@ impl<'a, T: Rle, A: RleTreeTrait> LeafNode<'a, T, A> { end.slice(del_relative_to, end.atom_len()), ); - *end = (BumpBox::new_in(left, self.bump)); + *end = BumpBox::new_in(left, self.bump); result = self._insert_with_split(del_end + 1, right, notify); handled = true; } @@ -740,13 +740,13 @@ impl<'a, T: Rle, A: RleTreeTrait> LeafNode<'a, T, A> { if index <= self.children.len() { notify(&value, self); self.children - .insert(index, (BumpBox::new_in(value, self.bump))); + .insert(index, BumpBox::new_in(value, self.bump)); } else { let leaf = ans.as_leaf_mut().unwrap(); notify(&value, leaf); leaf.children.insert( index - self.children.len(), - (BumpBox::new_in(value, self.bump)), + BumpBox::new_in(value, self.bump), ); } @@ -754,7 +754,7 @@ impl<'a, T: Rle, A: RleTreeTrait> LeafNode<'a, T, A> { } else { notify(&value, self); self.children - .insert(index, (BumpBox::new_in(value, self.bump))); + .insert(index, BumpBox::new_in(value, self.bump)); Ok(()) } }