feat(Rust): support sli_int64 compression#2914
Closed
urlyy wants to merge 5 commits intoapache:mainfrom
Closed
Conversation
chaokunyang
reviewed
Nov 15, 2025
| #[inline(always)] | ||
| pub fn write_sliint64(&mut self, value: i64) { | ||
| if value >= HALF_MIN_INT && value <= HALF_MAX_INT { | ||
| if (HALF_MIN_INT..=HALF_MAX_INT).contains(&value) { |
Collaborator
There was a problem hiding this comment.
Why use this range instead of conditional?
Contributor
Author
There was a problem hiding this comment.
This is the lint error and hint I got:
$ cargo clippy --all-targets --all-features -- -D warnings
error: manual `RangeInclusive::contains` implementation
--> fory-core\src\buffer.rs:182:12
|
182 | if value >= HALF_MIN_INT && value <= HALF_MAX_INT {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(HALF_MIN_INT..=HALF_MAX_INT).contains(&value)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
= note: `-D clippy::manual-range-contains` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_range_contains)]`You can see detail at https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
Maybe more Rust-idiomatic, but actually, I think the condition is still more intuitive.
Contributor
Author
|
Since the tests for RustXlangTest are identical to CPPXlangTest, and |
Collaborator
|
Let me implement it in another PR for c++ |
Contributor
Author
ok😀 |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Writer::write_sliint64(...)andReader::read_sliint64(...)to support SLI_INT64 compression.Reader::read_i32/i64/sliint64()andWriter::read_i32/i64/sliint64().Related issues
#2903
Does this PR introduce any user-facing change?
new methods:
Writer::write_sliint64(...)andReader::read_sliint64(...)