Skip to content

Commit

Permalink
Fix Clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Nov 5, 2024
1 parent 15eacfd commit 8214737
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions benches/syscall_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ fn uring_bench(path: &Path) {
let mut file = OpenOptions::new()
.read(true)
.write(true)
.truncate(true)
.create(true)
.open(path)
.unwrap();
Expand Down Expand Up @@ -206,6 +207,7 @@ fn readwrite_bench(path: &Path) {
let mut file = OpenOptions::new()
.read(true)
.write(true)
.truncate(true)
.create(true)
.open(path)
.unwrap();
Expand Down Expand Up @@ -268,6 +270,7 @@ fn mmap_bench(path: &Path) {
let file = OpenOptions::new()
.read(true)
.write(true)
.truncate(true)
.create(true)
.open(path)
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions benches/userspace_cache_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ mod unix {
let file = OpenOptions::new()
.read(true)
.write(true)
.truncate(true)
.create(true)
.open(path)
.unwrap();
Expand Down Expand Up @@ -350,6 +351,7 @@ mod unix {
let file = OpenOptions::new()
.read(true)
.write(true)
.truncate(true)
.create(true)
.open(path)
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions examples/special_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ impl SpecialValuesDb {
database: Database::create("index.redb").unwrap(),
file: OpenOptions::new()
.write(true)
.truncate(true)
.create(true)
.read(true)
.open("values.dat")
Expand Down
5 changes: 4 additions & 1 deletion src/tree_store/page_store/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,10 @@ mod test {
// IETF Memo "Care and Feeding of Magic Numbers"

// Test that magic number is not valid utf-8
assert!(std::str::from_utf8(&MAGICNUMBER).is_err());
#[allow(invalid_from_utf8)]
{
assert!(std::str::from_utf8(&MAGICNUMBER).is_err());
}
// Test there is a octet with high-bit set
assert!(MAGICNUMBER.iter().any(|x| *x & 0x80 != 0));
// Test there is a non-printable ASCII character
Expand Down
2 changes: 1 addition & 1 deletion tests/basic_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ fn extract_if() {
let mut table = write_txn.open_table(U64_TABLE).unwrap();
assert_eq!(table.len().unwrap(), 10);
for _ in table.extract_if(|x, _| x % 2 != 0).unwrap() {}
table.extract_if(|_, _| true).unwrap().rev().next();
table.extract_if(|_, _| true).unwrap().next_back();
}
write_txn.commit().unwrap();

Expand Down

0 comments on commit 8214737

Please sign in to comment.