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

Implement serde traits for ego-tree #34

Merged
merged 17 commits into from
Aug 29, 2024
Merged

Implement serde traits for ego-tree #34

merged 17 commits into from
Aug 29, 2024

Conversation

LoZack19
Copy link
Contributor

@LoZack19 LoZack19 commented Aug 28, 2024

Solves #21

I encapsulated everything inside the serde module. I implemented manually Serialize and Deseriaize for

  • Tree<T>
  • Node<T>
  • NodeId

Needs a review focused on security, and maybe more tests.

@LoZack19 LoZack19 linked an issue Aug 28, 2024 that may be closed by this pull request
Cargo.toml Outdated Show resolved Hide resolved
@cfvescovo
Copy link
Member

cfvescovo commented Aug 28, 2024

I will perform a more thorough review ASAP tomorrow morning

Remove disgusting whitespace
@LoZack19 LoZack19 requested a review from cfvescovo August 28, 2024 20:35
@LoZack19 LoZack19 self-assigned this Aug 28, 2024
Cargo.toml Outdated Show resolved Hide resolved
src/serde.rs Outdated Show resolved Hide resolved
tests/serde.rs Outdated Show resolved Hide resolved
tests/serde.rs Outdated Show resolved Hide resolved
tests/serde.rs Outdated Show resolved Hide resolved
@LoZack19
Copy link
Contributor Author

Since it doesn't look that this will be merged any time soon, I'll convert this to a draft

@LoZack19 LoZack19 marked this pull request as draft August 29, 2024 08:57
src/serde.rs Outdated Show resolved Hide resolved
src/serde.rs Outdated Show resolved Hide resolved
@LoZack19
Copy link
Contributor Author

I addressed the various issues that had been pointed out to me. All that is missing are more serious tests with serde_test. In particular, I created two auxiliary representations to serialize and deserialize data. The tree is forced to go through these representations, which should protect the output from invariant violations. Check out weather you like it, and feel free to point out new issues.

@LoZack19 LoZack19 requested a review from adamreichold August 29, 2024 12:03
src/serde.rs Show resolved Hide resolved
src/serde.rs Outdated Show resolved Hide resolved
LoZack19 and others added 5 commits August 29, 2024 14:57
Co-authored-by: Carlo Federico Vescovo <cfvescovo@users.noreply.github.com>
Correct some typos too

Co-authored-by: Giovanni Zaccaria <71092108+lozack19@users.noreply.github.com>
@cfvescovo cfvescovo marked this pull request as ready for review August 29, 2024 14:57
@LoZack19 LoZack19 requested a review from cfvescovo August 29, 2024 14:57
src/lib.rs Outdated Show resolved Hide resolved
src/serde.rs Outdated Show resolved Hide resolved
src/serde.rs Outdated Show resolved Hide resolved
Copy link
Member

@adamreichold adamreichold left a comment

Choose a reason for hiding this comment

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

Just some nits but I agree with the overall approach.

I would also like to thank you for keeping with us and manually implement the structure deserialization which really is a mouthful.

cfvescovo and others added 3 commits August 29, 2024 18:00
@cfvescovo
Copy link
Member

LGTM, merging now

@cfvescovo cfvescovo merged commit b3a9be1 into master Aug 29, 2024
5 checks passed
@adamreichold adamreichold deleted the serde branch August 29, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serde derive support?
3 participants