From f0d0cd9a20979f59db246e6a545ddc1b7bbb20b3 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 21 Feb 2022 23:10:13 +0100 Subject: Remove strum crate dependency; add protobuf nix dependency --- src/api/Cargo.toml | 3 --- src/api/api_server.rs | 2 +- src/api/s3_router.rs | 4 +--- 3 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src') 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, -- cgit v1.2.3