Skip to content

Commit bf60c40

Browse files
authored
Adding clean option for build script and fixing current clippy issues (#67)
Signed-off-by: zackcam <[email protected]>
1 parent 5b95585 commit bf60c40

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ SERVER_VERSION=8.0.0
4343
# Build with asan, you may need to remove the old valkey binary if you have used ./build.sh before. You can do this by deleting the `.build` folder in the `tests` folder
4444
ASAN_BUILD=true
4545
./build.sh
46+
# Clean build artifacts
47+
./build.sh clean
4648
```
4749

4850
## Load the Module

build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ set -e
88
SCRIPT_DIR=$(pwd)
99
echo "Script Directory: $SCRIPT_DIR"
1010

11+
if [ "$1" = "clean" ]; then
12+
echo "Cleaning build artifacts"
13+
rm -rf target/
14+
rm -rf tests/build/
15+
rm -rf test-data/
16+
echo "Clean completed."
17+
exit 0
18+
fi
19+
1120
echo "Running cargo and clippy format checks..."
1221
cargo fmt --check
1322
cargo clippy --profile release --all-targets -- -D clippy::all

src/bloom/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,15 +488,15 @@ impl BloomObject {
488488
/// * `capacity` - The size of the initial filter in the bloom object.
489489
/// * `fp_rate` - the false positive rate for the bloom object
490490
/// * `validate_scale_to` - the capacity we check to see if it can scale to. If this method is called from BF.INFO this is set as -1 as we
491-
/// want to check the maximum size we could scale up till
491+
/// want to check the maximum size we could scale up till
492492
/// * `tightening_ratio` - The tightening ratio of the object
493493
/// * `expansion` - The expanison rate of the object
494494
///
495495
/// # Returns
496496
/// * i64 - The maximum capacity that can be reached if called from BF.INFO. If called from BF.INSERT the size it reached when it became greater than `validate_scale_to`
497497
/// * ValkeyError - Can return two different errors:
498-
/// VALIDATE_SCALE_TO_EXCEEDS_MAX_SIZE: When scaling to the wanted capacity would go over the bloom object memory limit
499-
/// VALIDATE_SCALE_TO_FALSE_POSITIVE_INVALID: When scaling to the wanted capacity would cause the false positive rate to reach 0
498+
/// VALIDATE_SCALE_TO_EXCEEDS_MAX_SIZE: When scaling to the wanted capacity would go over the bloom object memory limit
499+
/// VALIDATE_SCALE_TO_FALSE_POSITIVE_INVALID: When scaling to the wanted capacity would cause the false positive rate to reach 0
500500
pub fn calculate_max_scaled_capacity(
501501
capacity: i64,
502502
fp_rate: f64,

0 commit comments

Comments
 (0)