Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
sdankel committed Oct 9, 2024
1 parent 3dac88e commit c3db3ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use rocket::{serde::json::Json, State};
use std::fs::{self};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::time::Instant;
use uuid::Uuid;

#[derive(Default)]
Expand Down
14 changes: 5 additions & 9 deletions src/pinata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ impl PinataClient for PinataClientImpl {
api.test_authentication()
.await
.map_err(|_| UploadError::Authentication)?;
return Ok(PinataClientImpl { pinata_api: api });
Ok(PinataClientImpl { pinata_api: api })
}
_ => {
return Err(UploadError::Ipfs);
Err(UploadError::Ipfs)
}
}
}
Expand All @@ -51,14 +51,10 @@ impl PinataClient for PinataClientImpl {
pub struct MockPinataClient;

impl PinataClient for MockPinataClient {
fn new() -> impl std::future::Future<Output = Result<Self, UploadError>> + Send {
async { Ok(MockPinataClient) }
}
async fn new() -> Result<Self, UploadError> { Ok(MockPinataClient) }

fn upload_file_to_ipfs(
async fn upload_file_to_ipfs(
&self,
_path: &PathBuf,
) -> impl std::future::Future<Output = Result<String, UploadError>> + Send {
async { Ok("ABC123".to_string()) }
}
) -> Result<String, UploadError> { Ok("ABC123".to_string()) }
}
4 changes: 1 addition & 3 deletions src/upload.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::models::NewUpload;
use crate::pinata::{self, PinataClient, PinataClientImpl};
use crate::pinata::{PinataClient};
use flate2::read::GzDecoder;
use flate2::write::GzEncoder;
use flate2::Compression;
use pinata_sdk::{PinByFile, PinataApi};
use std::env;
use std::fs::{self, File};
use std::io::Write;
use std::path::Path;
Expand Down

0 comments on commit c3db3ef

Please sign in to comment.