diff --git a/Cargo.lock b/Cargo.lock index 7454d58e..8661c379 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -796,8 +796,6 @@ dependencies = [ "serde_bytes", "serde_json", "sha2", - "strum", - "strum_macros", "tokio", "tracing", "url", @@ -2300,25 +2298,6 @@ dependencies = [ "syn", ] -[[package]] -name = "strum" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" - -[[package]] -name = "strum_macros" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn", -] - [[package]] name = "subtle" version = "2.4.1" diff --git a/Cargo.nix b/Cargo.nix index 7fb76d2c..c7e69d3c 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -596,7 +596,7 @@ in registry = "registry+https://github.com/rust-lang/crates.io-index"; src = fetchCratesIo { inherit name version; sha256 = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"; }; dependencies = { - ${ if hostPlatform.config == "aarch64-apple-darwin" || hostPlatform.parsed.cpu.name == "aarch64" && hostPlatform.parsed.kernel.name == "linux" then "libc" else null } = rustPackages."registry+https://github.com/rust-lang/crates.io-index".libc."0.2.115" { inherit profileName; }; + ${ if hostPlatform.parsed.cpu.name == "aarch64" && hostPlatform.parsed.kernel.name == "linux" || hostPlatform.config == "aarch64-apple-darwin" then "libc" else null } = rustPackages."registry+https://github.com/rust-lang/crates.io-index".libc."0.2.115" { inherit profileName; }; }; }); @@ -1135,8 +1135,6 @@ in serde_bytes = rustPackages."registry+https://github.com/rust-lang/crates.io-index".serde_bytes."0.11.5" { inherit profileName; }; serde_json = rustPackages."registry+https://github.com/rust-lang/crates.io-index".serde_json."1.0.68" { inherit profileName; }; sha2 = rustPackages."registry+https://github.com/rust-lang/crates.io-index".sha2."0.9.8" { inherit profileName; }; - strum = rustPackages."registry+https://github.com/rust-lang/crates.io-index".strum."0.23.0" { inherit profileName; }; - strum_macros = buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".strum_macros."0.23.1" { profileName = "__noProfile"; }; tokio = rustPackages."registry+https://github.com/rust-lang/crates.io-index".tokio."1.12.0" { inherit profileName; }; tracing = rustPackages."registry+https://github.com/rust-lang/crates.io-index".tracing."0.1.31" { inherit profileName; }; url = rustPackages."registry+https://github.com/rust-lang/crates.io-index".url."2.2.2" { inherit profileName; }; @@ -3114,31 +3112,6 @@ in }; }); - "registry+https://github.com/rust-lang/crates.io-index".strum."0.23.0" = overridableMkRustCrate (profileName: rec { - name = "strum"; - version = "0.23.0"; - registry = "registry+https://github.com/rust-lang/crates.io-index"; - src = fetchCratesIo { inherit name version; sha256 = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb"; }; - features = builtins.concatLists [ - [ "default" ] - [ "std" ] - ]; - }); - - "registry+https://github.com/rust-lang/crates.io-index".strum_macros."0.23.1" = overridableMkRustCrate (profileName: rec { - name = "strum_macros"; - version = "0.23.1"; - registry = "registry+https://github.com/rust-lang/crates.io-index"; - src = fetchCratesIo { inherit name version; sha256 = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38"; }; - dependencies = { - heck = rustPackages."registry+https://github.com/rust-lang/crates.io-index".heck."0.3.3" { inherit profileName; }; - proc_macro2 = rustPackages."registry+https://github.com/rust-lang/crates.io-index".proc-macro2."1.0.30" { inherit profileName; }; - quote = rustPackages."registry+https://github.com/rust-lang/crates.io-index".quote."1.0.10" { inherit profileName; }; - rustversion = buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".rustversion."1.0.5" { profileName = "__noProfile"; }; - syn = rustPackages."registry+https://github.com/rust-lang/crates.io-index".syn."1.0.80" { inherit profileName; }; - }; - }); - "registry+https://github.com/rust-lang/crates.io-index".subtle."2.4.1" = overridableMkRustCrate (profileName: rec { name = "subtle"; version = "2.4.1"; diff --git a/shell.nix b/shell.nix index 48c76e37..c570df2d 100644 --- a/shell.nix +++ b/shell.nix @@ -76,6 +76,7 @@ function refresh_toolchain { pkgs.rustPlatform.rust.cargo pkgs.clippy pkgs.rustfmt + pkgs.protobuf cargo2nix.packages.x86_64-linux.cargo2nix ] else []) ++ diff --git a/src/api/Cargo.toml b/src/api/Cargo.toml index 968e8aab..f39c6d04 100644 --- a/src/api/Cargo.toml +++ b/src/api/Cargo.toml @@ -31,9 +31,6 @@ md-5 = "0.9" nom = "7.1" sha2 = "0.9" -strum = "0.23" -strum_macros = "0.23" - futures = "0.3" futures-util = "0.3" pin-project = "1.0" diff --git a/src/api/api_server.rs b/src/api/api_server.rs index 00d582d1..1bab3aaa 100644 --- a/src/api/api_server.rs +++ b/src/api/api_server.rs @@ -135,7 +135,7 @@ async fn handler_inner(garage: Arc, req: Request) -> Result(format!("S3 API {}", endpoint)); + .update_name::(format!("S3 API {}", endpoint.name())); // Some endpoints are processed early, before we even check for an API key if let Endpoint::PostObject = endpoint { diff --git a/src/api/s3_router.rs b/src/api/s3_router.rs index c325805d..95a7eceb 100644 --- a/src/api/s3_router.rs +++ b/src/api/s3_router.rs @@ -5,8 +5,6 @@ use std::borrow::Cow; use hyper::header::HeaderValue; use hyper::{HeaderMap, Method, Request}; -use strum_macros::Display; - /// This macro is used to generate very repetitive match {} blocks in this module /// It is _not_ made to be used anywhere else macro_rules! s3_match { @@ -135,7 +133,7 @@ s3_match! {@func /// query parameters). Parameters it may receive by header are left out, however headers are /// considered when required to determine between one endpoint or another (for CopyObject and /// UploadObject, for instance). -#[derive(Debug, Clone, PartialEq, Eq, Display)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Endpoint { AbortMultipartUpload { key: String,