chore: cargo fmt missing from master

This commit is contained in:
Joonas Koivunen 2020-04-15 14:25:24 +03:00 committed by Mark Robert Henderson
parent 771f376192
commit a89ce4be45
2 changed files with 8 additions and 12 deletions

View File

@ -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)
@ -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 {};

View File

@ -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();