Skip to content

Fix review follow-ups for Rust APIs and benches#935

Merged
zxch3n merged 2 commits intoloro-dev:mainfrom
zxch3n:codex/fix-rust-review-items
Mar 23, 2026
Merged

Fix review follow-ups for Rust APIs and benches#935
zxch3n merged 2 commits intoloro-dev:mainfrom
zxch3n:codex/fix-rust-review-items

Conversation

@zxch3n
Copy link
Copy Markdown
Member

@zxch3n zxch3n commented Mar 23, 2026

Summary

  • return None instead of panicking in get_editor_at_unicode_pos, and add a regression test
  • update stale benchmark call sites to the current text txn API and fix a pending benchmark bug
  • make the trusted kv-store lazy decode path explicit and remove the extra re-boxing in diff calculators

Verification

  • cargo test -p loro get_editor -- --nocapture
  • cargo check -p loro-internal --benches --all-features
  • cargo check -p loro-kv-store
  • cargo clippy --workspace --all-targets --all-features --message-format=short

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3fb676b97

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

}

pub fn decode(
pub(crate) fn decode_verified(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep Block::decode public for downstream callers

loro-kv-store still exposes crates/kv-store/src/lib.rs's pub mod block, so turning Block::decode into the crate-private decode_verified is a semver-breaking API regression for external crates that currently decode already-validated blocks themselves. The workspace still compiles because every in-tree caller is internal, but any downstream Block::decode(...) call will stop compiling after this patch.

Useful? React with 👍 / 👎.

@zxch3n zxch3n merged commit 70daca2 into loro-dev:main Mar 23, 2026
1 check passed
@zxch3n zxch3n deleted the codex/fix-rust-review-items branch March 23, 2026 15:12
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.

1 participant