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 6, 2024
1 parent 15eacfd commit e3e950f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions benches/int_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

use std::env::current_dir;
use std::fs;
use tempfile::{NamedTempFile, TempDir};
Expand Down
2 changes: 2 additions & 0 deletions benches/large_values_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

use std::env::current_dir;
use tempfile::{NamedTempFile, TempDir};

Expand Down
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
1 change: 1 addition & 0 deletions src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ pub enum Durability {
/// 2. can introduce crashes during fsync(),
/// 3. has knowledge of the database file contents, and
/// 4. can include arbitrary data in a write transaction
///
/// could cause a transaction to partially commit (some but not all of the data is written).
/// This is described in the design doc in futher detail.
///
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 e3e950f

Please sign in to comment.