Fix clippy
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Alex 2022-04-13 17:41:55 +02:00
parent e6f40c4cfa
commit 03bfdfb4ef
Signed by: lx
GPG Key ID: 0E496D15096376BE
4 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ use crate::error::*;
pub(crate) trait ApiEndpoint: Send + Sync + 'static {
fn name(&self) -> &'static str;
fn add_span_attributes<'a>(&self, span: SpanRef<'a>);
fn add_span_attributes(&self, span: SpanRef<'_>);
}
#[async_trait]

View File

@ -9,8 +9,8 @@ use hyper::{Body, Method, Request, Response};
use opentelemetry::{trace::SpanRef, KeyValue};
use garage_util::error::Error as GarageError;
use garage_table::util::*;
use garage_util::error::Error as GarageError;
use garage_model::garage::Garage;
use garage_model::key_table::Key;
@ -96,7 +96,7 @@ impl ApiHandler for S3ApiServer {
.and_then(|root_domain| host_to_bucket(&host, root_domain));
let (endpoint, bucket_name) =
Endpoint::from_request(&req, bucket_name.map(ToOwned::to_owned))?;
Endpoint::from_request(req, bucket_name.map(ToOwned::to_owned))?;
Ok(S3ApiEndpoint {
bucket_name,
@ -432,7 +432,7 @@ impl ApiEndpoint for S3ApiEndpoint {
self.endpoint.name()
}
fn add_span_attributes<'a>(&self, span: SpanRef<'a>) {
fn add_span_attributes(&self, span: SpanRef<'_>) {
span.set_attribute(KeyValue::new(
"bucket",
self.bucket_name.clone().unwrap_or_default(),

View File

@ -151,8 +151,7 @@ impl Garage {
);
// ---- K2V tables ----
let k2v_item_table =
Table::new(K2VItemTable {}, meta_rep_param.clone(), system.clone(), &db);
let k2v_item_table = Table::new(K2VItemTable {}, meta_rep_param, system.clone(), &db);
info!("Initialize Garage...");

View File

@ -203,6 +203,7 @@ impl TableSchema for K2VItemTable {
// nothing for now
}
#[allow(clippy::nonminimal_bool)]
fn matches_filter(entry: &Self::E, filter: &Self::Filter) -> bool {
let v = entry.values();
!(filter.conflicts_only && v.len() < 2)