Skip to content

Commit

Permalink
clippy fix and health check
Browse files Browse the repository at this point in the history
  • Loading branch information
rustchain64 committed Oct 22, 2023
1 parent b0db557 commit 8c2b8d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/backend/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
16 changes: 4 additions & 12 deletions src/frontend/http.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
use std::{
net::SocketAddr,
str::FromStr,
sync::{Arc, Mutex},
};
use std::{net::SocketAddr, str::FromStr};

use anyhow::{anyhow, Result};

Expand All @@ -28,11 +24,7 @@ use crate::{
prelude::*,
};

async fn write_file_handler(
pk: &str,
mut body: BodyStream,
name: Option<String>,
) -> Result<String> {
async fn write_file_handler(pk: &str, body: BodyStream, name: Option<String>) -> Result<String> {
let pk = &Secp256k1PubKey::try_from(pk)?;

let is_mime_type = "default_mime_type".to_string();
Expand All @@ -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 {
Expand Down Expand Up @@ -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())
}
Expand Down

0 comments on commit 8c2b8d7

Please sign in to comment.