Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
chore: cargo fmt missing from master
Browse files Browse the repository at this point in the history
  • Loading branch information
Joonas Koivunen authored and aphelionz committed Apr 15, 2020
1 parent 771f376 commit a89ce4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 2 additions & 8 deletions http/src/v0/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ pub struct GetQuery {
arg: String,
}

async fn get_query<T: IpfsTypes>(
ipfs: Ipfs<T>,
query: GetQuery,
) -> Result<impl Reply, Rejection> {
async fn get_query<T: IpfsTypes>(ipfs: Ipfs<T>, query: GetQuery) -> Result<impl Reply, Rejection> {
let cid: Cid = query.arg.parse().map_err(StringError::from)?;
let data = ipfs
.get_block(&cid)
Expand Down Expand Up @@ -120,10 +117,7 @@ pub struct RmQuery {
#[serde(rename_all = "PascalCase")]
pub struct RmResponse {}

async fn rm_query<T: IpfsTypes>(
ipfs: Ipfs<T>,
query: RmQuery,
) -> Result<impl Reply, Rejection> {
async fn rm_query<T: IpfsTypes>(ipfs: Ipfs<T>, query: RmQuery) -> Result<impl Reply, Rejection> {
let cid: Cid = query.arg.parse().map_err(StringError::from)?;
ipfs.remove_block(&cid).await.map_err(StringError::from)?;
let response = RmResponse {};
Expand Down
10 changes: 6 additions & 4 deletions http/src/v0/refs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ async fn inner_local<T: IpfsTypes>(ipfs: Ipfs<T>) -> Result<impl Reply, Rejectio
err: "".to_string(),
})
.map(|response| {
serde_json::to_string(&response).map_err(|e| {
eprintln!("error from serde_json: {}", e);
HandledErr
}).unwrap()
serde_json::to_string(&response)
.map_err(|e| {
eprintln!("error from serde_json: {}", e);
HandledErr
})
.unwrap()
})
.map(|ref_json| Ok(format!("{}{}", ref_json, "\n")))
.collect();
Expand Down

0 comments on commit a89ce4b

Please sign in to comment.