update cargo deps
This commit is contained in:
@@ -10,7 +10,7 @@ crdt-enc-tokio = {path="../../crdt-enc-tokio"}
|
||||
crdt-enc-sodium = {path="../../crdt-enc-sodium"}
|
||||
crdt-enc-gpgme = {path="../../crdt-enc-gpgme"}
|
||||
uuid = {version = "0.8", features = ["serde", "v4"]}
|
||||
crdts = "4"
|
||||
tokio = {version = "0.2", features = ["macros"]}
|
||||
crdts = "5"
|
||||
tokio = {version = "1", features = ["macros", "rt"]}
|
||||
anyhow = "1"
|
||||
futures = "0.3"
|
||||
|
||||
@@ -7,7 +7,7 @@ use uuid::Uuid;
|
||||
|
||||
const CURRENT_DATA_VERSION: Uuid = Uuid::from_u128(1u128);
|
||||
|
||||
#[tokio::main]
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn main() -> Result<()> {
|
||||
crdt_enc_sodium::init();
|
||||
|
||||
@@ -44,8 +44,8 @@ async fn main() -> Result<()> {
|
||||
|
||||
let op = repo.with_state(|s: &crdts::MVReg<u64, Uuid>| {
|
||||
let read_ctx = s.read();
|
||||
let add_ctx = read_ctx.derive_add_ctx(info.actor());
|
||||
let op = s.write(read_ctx.val.into_iter().max().unwrap_or(0) + 1, add_ctx);
|
||||
let new_val = read_ctx.val.iter().copied().max().unwrap_or(0) + 1;
|
||||
let op = s.write(new_val, read_ctx.derive_add_ctx(info.actor()));
|
||||
Ok(op)
|
||||
})?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user