chore: cargo fmt missing from master
This commit is contained in:
parent
771f376192
commit
a89ce4be45
@ -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 {};
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user