mirror of
https://github.com/loro-dev/loro.git
synced 2024-12-04 05:29:48 +00:00
chore: cargo fix
This commit is contained in:
parent
0a832194d8
commit
72e52d8925
9 changed files with 16 additions and 14 deletions
|
@ -15,8 +15,8 @@ use crate::{fx_map, value::InsertValue, LoroCore, LoroValue};
|
|||
#[test]
|
||||
fn basic() {
|
||||
let mut loro = LoroCore::default();
|
||||
let weak = Irc::downgrade(&loro.log_store);
|
||||
let mut container = loro.get_or_create_root_map("map".into()).unwrap();
|
||||
let _weak = Irc::downgrade(&loro.log_store);
|
||||
let mut container = loro.get_or_create_root_map("map").unwrap();
|
||||
container.insert("haha".into(), InsertValue::Int32(1));
|
||||
let ans = fx_map!(
|
||||
"haha".into() => LoroValue::Integer(1)
|
||||
|
@ -37,8 +37,8 @@ mod map_proptest {
|
|||
value in prop::collection::vec(gen_insert_value(), 0..10 * PROPTEST_FACTOR_10)
|
||||
) {
|
||||
let mut loro = LoroCore::default();
|
||||
let weak = Irc::downgrade(&loro.log_store);
|
||||
let mut container = loro.get_or_create_root_map("map".into()).unwrap();
|
||||
let _weak = Irc::downgrade(&loro.log_store);
|
||||
let mut container = loro.get_or_create_root_map("map").unwrap();
|
||||
let mut map: HashMap<String, InsertValue> = HashMap::new();
|
||||
for (k, v) in key.iter().zip(value.iter()) {
|
||||
map.insert(k.clone(), v.clone());
|
||||
|
|
|
@ -4,13 +4,16 @@ use smallvec::SmallVec;
|
|||
use crate::{
|
||||
container::{list::list_op::ListOp, text::tracker::yata_impl::YataImpl},
|
||||
debug_log,
|
||||
id::{ClientID, Counter, ID},
|
||||
id::{Counter, ID},
|
||||
op::OpContent,
|
||||
span::{HasIdSpan, IdSpan},
|
||||
version::IdSpanVector,
|
||||
VersionVector,
|
||||
};
|
||||
|
||||
#[allow(unused)]
|
||||
use crate::ClientID;
|
||||
|
||||
use self::{
|
||||
content_map::ContentMap,
|
||||
cursor_map::{make_notify, CursorMap, IdSpanQueryResult},
|
||||
|
|
|
@ -180,8 +180,6 @@ impl HasLength for YSpan {
|
|||
#[cfg(any(test, features = "fuzzing"))]
|
||||
pub mod test {
|
||||
use crate::{
|
||||
container::{ContainerID, ContainerType},
|
||||
id::ROOT_ID,
|
||||
op::{InsertContent, OpContent},
|
||||
ContentType, Op, ID,
|
||||
};
|
||||
|
|
|
@ -12,6 +12,7 @@ use std::{
|
|||
fmt::Debug,
|
||||
};
|
||||
|
||||
#[allow(unused)]
|
||||
use colored::Colorize;
|
||||
use fxhash::{FxHashMap, FxHashSet};
|
||||
use rle::{HasLength, Sliceable};
|
||||
|
|
|
@ -32,7 +32,7 @@ pub use error::LoroError;
|
|||
pub(crate) mod macros;
|
||||
pub(crate) use change::{Lamport, Timestamp};
|
||||
pub(crate) use id::{ClientID, ID};
|
||||
pub(crate) use op::{ContentType, InsertContentTrait, Op, OpType, RemoteOp};
|
||||
pub(crate) use op::{ContentType, InsertContentTrait, Op, OpType};
|
||||
|
||||
pub(crate) type InternalString = DefaultAtom;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ use crate::{
|
|||
isomorph::{Irc, IsoRw, IsoWeak},
|
||||
op::RemoteOp,
|
||||
span::{HasCounterSpan, HasIdSpan, HasLamportSpan, IdSpan},
|
||||
InternalString, Lamport, Op, Timestamp, VersionVector, ID,
|
||||
Lamport, Op, Timestamp, VersionVector, ID,
|
||||
};
|
||||
|
||||
const _YEAR: u64 = 365 * 24 * 60 * 60;
|
||||
|
@ -454,7 +454,7 @@ fn size_of() {
|
|||
id::ID,
|
||||
op::{InsertContent, Op},
|
||||
span::IdSpan,
|
||||
Container, InsertValue,
|
||||
Container, InsertValue, InternalString,
|
||||
};
|
||||
println!("Change {}", std::mem::size_of::<Change>());
|
||||
println!("Op {}", std::mem::size_of::<Op>());
|
||||
|
|
|
@ -136,7 +136,7 @@ impl Sliceable for Op {
|
|||
Op {
|
||||
counter: (self.counter + from as Counter),
|
||||
content,
|
||||
container: self.container.clone(),
|
||||
container: self.container,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ fn test() {
|
|||
drop(text_container);
|
||||
|
||||
store.import(store_b.export(store.vv()));
|
||||
let mut text_container = store.get_or_create_root_text("haha".into()).unwrap();
|
||||
let mut text_container = store.get_or_create_root_text("haha").unwrap();
|
||||
let value = text_container.get_value();
|
||||
let value = value.as_string().unwrap();
|
||||
assert_eq!(value.as_str(), "63417892");
|
||||
|
@ -43,7 +43,7 @@ fn test() {
|
|||
drop(text_container);
|
||||
|
||||
store_b.import(store.export(Default::default()));
|
||||
let mut text_container = store_b.get_or_create_root_text("haha".into()).unwrap();
|
||||
let mut text_container = store_b.get_or_create_root_text("haha").unwrap();
|
||||
text_container.check();
|
||||
let value = text_container.get_value();
|
||||
let value = value.as_string().unwrap();
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::{
|
|||
|
||||
use loro_core::{
|
||||
container::{Container, ContainerID},
|
||||
InsertValue, LoroCore, LoroError,
|
||||
InsertValue, LoroCore,
|
||||
};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
|
|
Loading…
Reference in a new issue