From 8c2b8d7fefb38e209ad8aba1382bb7f34d48e6c3 Mon Sep 17 00:00:00 2001 From: Wesley Parr Date: Sun, 22 Oct 2023 03:53:29 -0600 Subject: [PATCH] clippy fix and health check --- src/backend/fs.rs | 2 +- src/frontend/http.rs | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/backend/fs.rs b/src/backend/fs.rs index 238fcdc..6f8f37b 100644 --- a/src/backend/fs.rs +++ b/src/backend/fs.rs @@ -186,7 +186,7 @@ pub async fn write_catalog( move || { let cat_header = CatHeader { cbor_len, metadata }; - let cat_header_bytes = cat_header.try_to_vec()?; + let _cat_header_bytes = cat_header.try_to_vec()?; trace!("Get catalogs directory path"); let path = file_path(volume_index, &write_pk_str, CATALOG_DIR, &name)?; diff --git a/src/frontend/http.rs b/src/frontend/http.rs index 41d6e7e..2a84c2a 100644 --- a/src/frontend/http.rs +++ b/src/frontend/http.rs @@ -1,8 +1,4 @@ -use std::{ - net::SocketAddr, - str::FromStr, - sync::{Arc, Mutex}, -}; +use std::{net::SocketAddr, str::FromStr}; use anyhow::{anyhow, Result}; @@ -28,11 +24,7 @@ use crate::{ prelude::*, }; -async fn write_file_handler( - pk: &str, - mut body: BodyStream, - name: Option, -) -> Result { +async fn write_file_handler(pk: &str, body: BodyStream, name: Option) -> Result { let pk = &Secp256k1PubKey::try_from(pk)?; let is_mime_type = "default_mime_type".to_string(); @@ -51,7 +43,7 @@ async fn write_file_handler( let mut buffer = Vec::new(); buffer.extend_from_slice(&bytes); - is_mime_type = "test_mime_type".to_string(); + // is_mime_type = "test_mime_type".to_string(); let kind = infer::get(&buffer); // Use the extended buffer here match kind { @@ -84,7 +76,7 @@ async fn write_file_handler( ) .boxed(); - let Blake3Hash(hash) = write_file(pk, file_stream, name, "is_mime_type").await?; + let Blake3Hash(hash) = write_file(pk, file_stream, name, &is_mime_type).await?; Ok(hash.to_hex().to_string()) }