From e2fc4b4b88ae937621ac42dd227671d40cd0f921 Mon Sep 17 00:00:00 2001 From: Alexander Weiss Date: Sat, 3 Aug 2024 22:04:50 +0200 Subject: [PATCH 1/2] chore(deps): Several version updates --- Cargo.toml | 2 +- crates/backend/Cargo.toml | 8 ++++---- crates/backend/src/opendal.rs | 2 +- crates/core/Cargo.toml | 20 ++++++++++---------- crates/core/src/commands/restore.rs | 2 +- crates/core/src/repofile/snapshotfile.rs | 2 +- crates/core/src/repository.rs | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dcfe4211..79a2960d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ rustic_testing = { path = "crates/testing" } simplelog = "0.12.2" # dev-dependencies -rstest = "0.18.2" +rstest = "0.21.0" tempfile = "3.10.1" # see: https://nnethercote.github.io/perf-book/build-configuration.html diff --git a/crates/backend/Cargo.toml b/crates/backend/Cargo.toml index f72ecff7..b23fac21 100644 --- a/crates/backend/Cargo.toml +++ b/crates/backend/Cargo.toml @@ -55,7 +55,7 @@ log = "0.4.21" bytes = "1.5.0" derive_setters = "0.1.6" humantime = "2.1.0" -itertools = "0.12.1" +itertools = "0.13.0" strum = "0.26" strum_macros = "0.26" @@ -75,7 +75,7 @@ walkdir = "2.5.0" # rest backend backoff = { version = "0.4.0", optional = true } -reqwest = { version = "0.11.26", default-features = false, features = ["json", "rustls-tls-native-roots", "stream", "blocking"], optional = true } +reqwest = { version = "0.12.5", default-features = false, features = ["json", "rustls-tls-native-roots", "stream", "blocking"], optional = true } # rclone backend rand = { version = "0.8.5", optional = true } @@ -88,11 +88,11 @@ tokio = { version = "1.36.0", optional = true, default-features = false } [target.'cfg(not(windows))'.dependencies] # opendal backend - sftp is not supported on windows, see https://github.com/apache/incubator-opendal/issues/2963 -opendal = { version = "0.46", features = ["services-b2", "services-sftp", "services-swift", "services-azblob", "services-azdls", "services-cos", "services-fs", "services-gcs", "services-ghac", "services-http", "services-ipmfs", "services-memory", "services-obs", "services-oss", "services-s3", "services-webdav", "services-webhdfs", "services-azfile", "layers-blocking", "layers-throttle"], optional = true } +opendal = { version = "0.48.0", features = ["services-b2", "services-sftp", "services-swift", "services-azblob", "services-azdls", "services-cos", "services-fs", "services-gcs", "services-ghac", "services-http", "services-ipmfs", "services-memory", "services-obs", "services-oss", "services-s3", "services-webdav", "services-webhdfs", "services-azfile", "layers-blocking", "layers-throttle"], optional = true } [target.'cfg(windows)'.dependencies] # opendal backend -opendal = { version = "0.46", features = ["services-b2", "services-swift", "services-azblob", "services-azdls", "services-cos", "services-fs", "services-gcs", "services-ghac", "services-http", "services-ipmfs", "services-memory", "services-obs", "services-oss", "services-s3", "services-webdav", "services-webhdfs", "services-azfile", "layers-blocking", "layers-throttle"], optional = true } +opendal = { version = "0.48.0", features = ["services-b2", "services-swift", "services-azblob", "services-azdls", "services-cos", "services-fs", "services-gcs", "services-ghac", "services-http", "services-ipmfs", "services-memory", "services-obs", "services-oss", "services-s3", "services-webdav", "services-webhdfs", "services-azfile", "layers-blocking", "layers-throttle"], optional = true } [dev-dependencies] rstest = { workspace = true } diff --git a/crates/backend/src/opendal.rs b/crates/backend/src/opendal.rs index 73ef91b8..66f8a9cd 100644 --- a/crates/backend/src/opendal.rs +++ b/crates/backend/src/opendal.rs @@ -91,7 +91,7 @@ impl OpenDALBackend { .transpose()?; let schema = Scheme::from_str(path.as_ref())?; - let mut operator = Operator::via_map(schema, options)? + let mut operator = Operator::via_iter(schema, options)? .layer(RetryLayer::new().with_max_times(max_retries).with_jitter()); if let Some(Throttle { bandwidth, burst }) = throttle { diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 50b0f5a6..f00eb909 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -69,7 +69,7 @@ rand = "0.8.5" scrypt = { version = "0.11.0", default-features = false } # serialization / packing -binrw = "0.13.3" +binrw = "0.14.0" hex = { version = "0.4.3", features = ["serde"] } integer-sqrt = "0.1.5" serde = { version = "1.0.197" } @@ -79,11 +79,11 @@ serde_json = "1.0.114" serde_with = { version = "3.7.0", features = ["base64"] } # local source/destination -cached = { version = "0.49.2", default-features = false, features = ["proc_macro"] } +cached = { version = "0.53.1", default-features = false, features = ["proc_macro"] } dunce = "1.0.4" filetime = "0.2.23" ignore = "0.4.22" -nix = { version = "0.28", default-features = false, features = ["user", "fs"] } +nix = { version = "0.29.0", default-features = false, features = ["user", "fs"] } path-dedot = "3.1.1" walkdir = "2.5.0" @@ -96,8 +96,8 @@ clap = { version = "4.5.2", optional = true, features = ["derive", "env", "wrap_ merge = { version = "0.1.0", optional = true } # vfs support -dav-server = { version = "0.5.8", default-features = false, optional = true } -futures = { version = "0.3", optional = true } +dav-server = { version = "0.7.0", default-features = false, optional = true } +futures = { version = "0.3.30", optional = true } runtime-format = "0.1.3" # other dependencies @@ -110,18 +110,18 @@ enum-map-derive = "0.17.0" enumset = { version = "1.1.3", features = ["serde"] } gethostname = "0.4.3" humantime = "2.1.0" -itertools = "0.12.1" -quick_cache = "0.4.1" +itertools = "0.13.0" +quick_cache = "0.6.2" strum = { version = "0.26.2", features = ["derive"] } zstd = "0.13.0" [target.'cfg(not(windows))'.dependencies] -sha2 = { version = "0.10", features = ["asm"] } +sha2 = { version = "0.10.8", features = ["asm"] } [target.'cfg(windows)'.dependencies] # unfortunately, the asm extensions do not build on Windows, see https://github.com/RustCrypto/asm-hashes/issues/17 # and https://github.com/RustCrypto/asm-hashes/pull/issues/78 -sha2 = "0.10" +sha2 = "0.10.8" [target.'cfg(not(any(windows, target_os="openbsd")))'.dependencies] # for local source/destination @@ -132,7 +132,7 @@ expect-test = "1.4.1" flate2 = "1.0.28" globset = "0.4.14" insta = { version = "1.36.1", features = ["redactions", "ron"] } -mockall = "0.12.1" +mockall = "0.13" pretty_assertions = "1.4.0" quickcheck = "1.0.3" quickcheck_macros = "1.0.0" diff --git a/crates/core/src/commands/restore.rs b/crates/core/src/commands/restore.rs index 8bf9324f..9ef99ac2 100644 --- a/crates/core/src/commands/restore.rs +++ b/crates/core/src/commands/restore.rs @@ -508,7 +508,7 @@ fn restore_contents( }; // save into needed files in parallel - for (bl, group) in &name_dests.into_iter().group_by(|item| item.0.clone()) { + for (bl, group) in &name_dests.into_iter().chunk_by(|item| item.0.clone()) { let size = bl.data_length(); let data = if from_file.is_some() { read_data.clone() diff --git a/crates/core/src/repofile/snapshotfile.rs b/crates/core/src/repofile/snapshotfile.rs index dcdda774..e4224afd 100644 --- a/crates/core/src/repofile/snapshotfile.rs +++ b/crates/core/src/repofile/snapshotfile.rs @@ -641,7 +641,7 @@ impl SnapshotFile { let mut result = Vec::new(); for (group, snaps) in &snaps .into_iter() - .group_by(|sn| SnapshotGroup::from_snapshot(sn, crit)) + .chunk_by(|sn| SnapshotGroup::from_snapshot(sn, crit)) { result.push((group, snaps.collect())); } diff --git a/crates/core/src/repository.rs b/crates/core/src/repository.rs index 3d399ba8..2bc7863b 100644 --- a/crates/core/src/repository.rs +++ b/crates/core/src/repository.rs @@ -1288,9 +1288,9 @@ impl IndexedTree for Repository { pub(crate) struct BytesWeighter; impl quick_cache::Weighter for BytesWeighter { - fn weight(&self, _key: &Id, val: &Bytes) -> u32 { + fn weight(&self, _key: &Id, val: &Bytes) -> u64 { // Be cautions out about zero weights! - u32::try_from(val.len().clamp(1, u32::MAX as usize)) + u64::try_from(val.len().clamp(1, u64::MAX as usize)) .expect("weight overflow in cache should not happen") } } From 53d0500f98fcfb93817085ee450979db5ef771a2 Mon Sep 17 00:00:00 2001 From: Alexander Weiss Date: Mon, 5 Aug 2024 06:38:06 +0200 Subject: [PATCH 2/2] clippy lints --- crates/core/src/repository.rs | 5 +++-- crates/core/src/vfs/webdavfs.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/core/src/repository.rs b/crates/core/src/repository.rs index 2bc7863b..de8f1f16 100644 --- a/crates/core/src/repository.rs +++ b/crates/core/src/repository.rs @@ -1289,9 +1289,10 @@ pub(crate) struct BytesWeighter; impl quick_cache::Weighter for BytesWeighter { fn weight(&self, _key: &Id, val: &Bytes) -> u64 { - // Be cautions out about zero weights! - u64::try_from(val.len().clamp(1, u64::MAX as usize)) + u64::try_from(val.len()) .expect("weight overflow in cache should not happen") + // Be cautions out about zero weights! + .max(1) } } diff --git a/crates/core/src/vfs/webdavfs.rs b/crates/core/src/vfs/webdavfs.rs index 8c8dc44e..1813b612 100644 --- a/crates/core/src/vfs/webdavfs.rs +++ b/crates/core/src/vfs/webdavfs.rs @@ -154,7 +154,7 @@ impl = Box::new(DavFsDirEntry(e)); - entry + Ok(entry) }); let strm: FsStream> = Box::pin(futures::stream::iter(entry_iter)); Ok(strm)