From 12dd378fca8cb6a994b9a0d003837e3c64009739 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 14 Apr 2022 16:22:21 +0200 Subject: [PATCH] fix clippy --- src/api/k2v/item.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/api/k2v/item.rs b/src/api/k2v/item.rs index 2a1bb049..e1c205d5 100644 --- a/src/api/k2v/item.rs +++ b/src/api/k2v/item.rs @@ -1,13 +1,10 @@ //! Function related to GET and HEAD requests use std::sync::Arc; -use std::time::{Duration, UNIX_EPOCH}; -use futures::stream::*; use http::header; -use hyper::body::Bytes; + use hyper::{Body, Request, Response, StatusCode}; -use garage_table::EmptyKey; use garage_util::data::*; use garage_model::garage::Garage; @@ -15,7 +12,7 @@ use garage_model::k2v::item_table::*; use crate::error::*; -const X_GARAGE_CAUSALITY_TOKEN: &'static str = "X-Garage-Causality-Token"; +const X_GARAGE_CAUSALITY_TOKEN: &str = "X-Garage-Causality-Token"; pub enum ReturnFormat { Json, @@ -45,7 +42,7 @@ impl ReturnFormat { pub fn make_response(&self, item: &K2VItem) -> Result, Error> { let vals = item.values(); - if vals.len() == 0 { + if vals.is_empty() { return Err(Error::NoSuchKey); } @@ -98,6 +95,7 @@ impl ReturnFormat { } /// Handle ReadItem request +#[allow(clippy::ptr_arg)] pub async fn handle_read_item( garage: Arc, req: &Request,