From d7755581502595ca9369f949bee09c33022bc6c2 Mon Sep 17 00:00:00 2001 From: Arnaud Gourlay Date: Thu, 15 Aug 2024 16:47:46 +0200 Subject: [PATCH] Fix Clippy & bump dependencies --- Cargo.toml | 18 +++++++++--------- src/lib.rs | 6 +++--- src/mmap_view_sync.rs | 1 + 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 907b7a4..2a68202 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,13 +13,13 @@ repository = "https://github.com/qdrant/wal" edition = "2021" [dependencies] -byteorder = "1.4" -crc32c = "0.6.4" +byteorder = "1.5" +crc32c = "0.6.8" log = "0.4" -memmap2 = "0.9.0" +memmap2 = "0.9.4" rand = "0.8.5" rand_distr = "0.4.3" -fs4 = "0.8" +fs4 = "0.9.1" # fs4 depends on rustix, but pulling this dependency explicitly into the tree # to use direct functions on FreeBSD rustix = { version = "0", features = [ "fs" ]} @@ -31,12 +31,12 @@ env_logger = "0.11" serde = { version = "1", features = ["derive"] } [dev-dependencies] -crc = "3" -hdrhistogram = "7.5.2" +crc = "3.2.1" +hdrhistogram = "7.5.4" quickcheck = "1.0.3" -regex = "1.8.1" -tempfile = "3.5.0" -chrono = "0.4.31" +regex = "1.10.6" +tempfile = "3.12.0" +chrono = "0.4.38" criterion = "0.5.1" [[bench]] diff --git a/src/lib.rs b/src/lib.rs index 85fc7e6..f94ac25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ use crossbeam_channel::{Receiver, Sender}; -use fs4::FileExt; use log::{debug, info, trace, warn}; use std::cmp::Ordering; use std::collections::HashMap; @@ -12,7 +11,7 @@ use std::path::{Path, PathBuf}; use std::result; use std::str::FromStr; use std::thread; - +use fs4::fs_std::FileExt; pub use segment::{Entry, Segment}; mod mmap_view_sync; @@ -514,7 +513,7 @@ impl Wal { segment.copy_to_path(&dst_path)?; } else { // if file is not locked by any Segment, just copy it - fs::copy(&entry.path(), &dst_path)?; + fs::copy(entry.path(), &dst_path)?; } } Ok(()) @@ -955,6 +954,7 @@ mod test { .read(true) .write(true) .create(true) + .truncate(true) .open(dir.path().join("tmp-open-123")) .unwrap(); diff --git a/src/mmap_view_sync.rs b/src/mmap_view_sync.rs index b73bbd4..758522a 100644 --- a/src/mmap_view_sync.rs +++ b/src/mmap_view_sync.rs @@ -237,6 +237,7 @@ mod test { .read(true) .write(true) .create(true) + .truncate(true) .open(path) .unwrap(); file.set_len(len).unwrap();