Remove the slash-path dependency

This commit is contained in:
Kerollmops
2025-11-06 10:53:07 +01:00
parent 6c6645f945
commit ff3090e3cc
3 changed files with 6 additions and 13 deletions

11
Cargo.lock generated
View File

@@ -1123,7 +1123,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "159fa412eae48a1d94d0b9ecdb85c97ce56eb2a347c62394d3fdbf221adabc1a"
dependencies = [
"path-matchers",
"path-slash 0.1.5",
"path-slash",
]
[[package]]
@@ -3259,7 +3259,6 @@ dependencies = [
"meilisearch-types",
"memmap2",
"page_size",
"path-slash 0.2.1",
"rayon",
"reqwest",
"roaring 0.10.12",
@@ -4785,12 +4784,6 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "498a099351efa4becc6a19c72aa9270598e8fd274ca47052e37455241c88b696"
[[package]]
name = "path-slash"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42"
[[package]]
name = "pbkdf2"
version = "0.12.2"
@@ -6267,7 +6260,7 @@ checksum = "f9c425c07353535ef55b45420f5a8b0a397cd9bc3d7e5236497ca0d90604aa9b"
dependencies = [
"change-detection",
"mime_guess",
"path-slash 0.1.5",
"path-slash",
]
[[package]]

View File

@@ -29,7 +29,6 @@ meilisearch-auth = { path = "../meilisearch-auth" }
meilisearch-types = { path = "../meilisearch-types" }
memmap2 = "0.9.7"
page_size = "0.6.0"
path-slash = "0.2.1"
rayon = "1.10.0"
roaring = { version = "0.10.12", features = ["serde"] }
serde = { version = "1.0.219", features = ["derive"] }

View File

@@ -246,7 +246,6 @@ impl IndexScheduler {
use std::path::PathBuf;
use bytes::{Bytes, BytesMut};
use path_slash::PathBufExt as _;
use reqwest::header::ETAG;
use reqwest::Client;
use reqwest::Response;
@@ -280,7 +279,7 @@ impl IndexScheduler {
let reader = OwnedFd::from(reader);
let reader = tokio::net::unix::pipe::Receiver::from_owned_fd(reader)?;
let s3_snapshot_prefix = PathBuf::from_slash(s3_snapshot_prefix);
let s3_snapshot_prefix = PathBuf::from(s3_snapshot_prefix);
let url = s3_bucket_url
.parse()
.map_err(BucketError::ParseError)
@@ -290,7 +289,9 @@ impl IndexScheduler {
let credential = Credentials::new(s3_access_key, s3_secret_key);
// Note for the future (rust 1.91+): use with_added_extension, it's prettier
let object_path = s3_snapshot_prefix.join(format!("{db_name}.snapshot"));
let object = object_path.to_slash().expect("Invalid UTF-8 path").into_owned();
// Note: It doesn't work on Windows and if a port to this platform is needed,
// use the slash-path crate or similar to get the correct path separator.
let object = object_path.display().to_string();
let action = bucket.create_multipart_upload(Some(&credential), &object);
let url = action.sign(s3_signature_duration);