Skip to content

[00037] Fix clippy unnecessary casts in lib.rs and unsafe extern in bench file#16

Merged
rorychatt merged 1 commit into
mainfrom
plan-00037-Ivy.NativeJsonDiff
Apr 12, 2026
Merged

[00037] Fix clippy unnecessary casts in lib.rs and unsafe extern in bench file#16
rorychatt merged 1 commit into
mainfrom
plan-00037-Ivy.NativeJsonDiff

Conversation

@rorychatt

Copy link
Copy Markdown
Collaborator

Changes

Removed 6 redundant as *const u8 casts from &str::as_ptr() calls in the test module of src/RustServer/src/lib.rs, and added unsafe keyword to the extern "C" block in src/RustServer/benches/diff_bench.rs for Rust 2024 edition compliance. These changes fix 7 clippy errors that appear when running cargo clippy --benches -- -D warnings.

API Changes

None.

Files Modified

  • src/RustServer/src/lib.rs - Removed unnecessary as *const u8 casts in test helper functions (diff(), apply()) and test cases (test_apply_patch_null_json, test_apply_patch_null_patch)
  • src/RustServer/benches/diff_bench.rs - Changed extern "C" to unsafe extern "C" for the FFI function declarations block

Commits

  • c8d5de2 [00037] Remove unnecessary casts and fix unsafe extern in Rust code

Remove 6 redundant `as *const u8` casts from `&str::as_ptr()` calls in
test module of lib.rs, and add `unsafe` keyword to `extern "C"` block
in diff_bench.rs for Rust 2024 edition compliance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rorychatt
rorychatt merged commit 0f7a6b9 into main Apr 12, 2026
1 of 2 checks passed
@rorychatt
rorychatt deleted the plan-00037-Ivy.NativeJsonDiff branch April 12, 2026 10:55
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