Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl crdt types #420

Closed
wants to merge 3 commits into from
Closed

impl crdt types #420

wants to merge 3 commits into from

Conversation

forehalo
Copy link
Member

@forehalo forehalo commented May 15, 2023

in these pr, there several things would be done:

  • finish the full update apply logic (only type related stuff left)
  • impl all Map/List based shared types
    • YText
    • YArray
    • YMap
    • YXMLElement
    • YXMLFragment
    • YXMLText

will close #405, close #409

@vercel
Copy link

vercel bot commented May 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
octobase ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2023 10:18am

@forehalo forehalo temporarily deployed to development May 15, 2023 10:34 — with GitHub Actions Inactive
@forehalo forehalo temporarily deployed to development May 15, 2023 10:34 — with GitHub Actions Inactive
@forehalo forehalo temporarily deployed to development May 15, 2023 10:34 — with GitHub Actions Inactive
@forehalo forehalo mentioned this pull request May 15, 2023
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clippy found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@Brooooooklyn
Copy link
Member

Brooooooklyn commented May 15, 2023

@forehalo does this crate help? https://docs.rs/crdts/latest/crdts/

@forehalo forehalo temporarily deployed to development May 16, 2023 10:29 — with GitHub Actions Inactive
@forehalo forehalo temporarily deployed to development May 16, 2023 10:29 — with GitHub Actions Inactive
@forehalo forehalo temporarily deployed to development May 16, 2023 10:29 — with GitHub Actions Inactive
@forehalo forehalo temporarily deployed to development May 17, 2023 11:01 — with GitHub Actions Inactive
@forehalo forehalo temporarily deployed to development May 17, 2023 11:01 — with GitHub Actions Inactive
@forehalo forehalo temporarily deployed to development May 17, 2023 11:01 — with GitHub Actions Inactive
libs/jwst-codec/src/doc/types/mod.rs Fixed Show fixed Hide fixed
libs/jwst-codec/src/doc/types/text.rs Fixed Show fixed Hide fixed
libs/jwst-codec/src/doc/types/text.rs Fixed Show fixed Hide fixed
libs/jwst-codec/src/doc/types/mod.rs Fixed Show fixed Hide fixed
libs/jwst-codec/src/doc/codec/update.rs Fixed Show fixed Hide fixed
libs/jwst-codec/src/doc/codec/update.rs Fixed Show fixed Hide fixed
};
}

pub enum Value {

Check warning

Code scanning / clippy

enum Value is never used Warning

enum Value is never used
@@ -90,6 +100,21 @@ impl StructInfo {
matches!(self, Self::Item { .. })
}

pub fn flags(&self) -> ItemFlags {
match self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if let

@forehalo forehalo temporarily deployed to development May 22, 2023 10:05 — with GitHub Actions Inactive
@forehalo forehalo temporarily deployed to development May 22, 2023 10:05 — with GitHub Actions Inactive
}

pub fn insert(&mut self, index: usize, text: String) {
let pos = self.find_position(index);

Check warning

Code scanning / clippy

unused variable: pos Warning

unused variable: pos
self.inner.borrow().len
}

pub fn insert(&mut self, index: usize, text: String) {

Check warning

Code scanning / clippy

unused variable: text Warning

unused variable: text
let pos = self.find_position(index);
}

fn find_position(&self, index: usize) -> Option<Item> {

Check warning

Code scanning / clippy

unused variable: index Warning

unused variable: index
Ok(())
}

pub fn split_item<I: Into<Id>>(&mut self, id: I, diff: u64) -> JwstCodecResult {

Check warning

Code scanning / clippy

method split_item is never used Warning

method split\_item is never used

use super::{TypeStore, TypeStoreKind, TypeStoreRef};

pub struct YText {

Check warning

Code scanning / clippy

field inner is never read Warning

field inner is never read
use super::{TypeStore, TypeStoreKind, TypeStoreRef};

pub struct YText {
inner: TypeStoreRef,

Check warning

Code scanning / clippy

field inner is never read Warning

field inner is never read
}

impl YText {
pub fn len(&self) -> usize {

Check warning

Code scanning / clippy

method len is never used Warning

method len is never used
@forehalo
Copy link
Member Author

need more discussion

@forehalo forehalo closed this May 23, 2023
@forehalo forehalo deleted the feat/crdt-types branch December 25, 2023 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crdt operations for map & test case crdt operations for list & test case
2 participants