From 76378740872da9026dd8beea35d1aba139ba8066 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Wed, 8 Jul 2020 19:42:47 +0300 Subject: [PATCH] refactor: reorder pub fn before inner impl --- http/src/v0/dag.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/http/src/v0/dag.rs b/http/src/v0/dag.rs index 8f0009cc..599c112b 100644 --- a/http/src/v0/dag.rs +++ b/http/src/v0/dag.rs @@ -30,6 +30,17 @@ impl Default for InputEncoding { } } +pub fn put( + ipfs: &Ipfs, +) -> impl Filter + Clone { + path!("dag" / "put") + .and(with_ipfs(ipfs)) + .and(query::()) + .and(warp::header::("content-type")) // TODO: rejects if missing + .and(warp::body::stream()) + .and_then(put_query) +} + async fn put_query( ipfs: Ipfs, query: PutQuery, @@ -81,17 +92,6 @@ async fn put_query( Ok(reply::json(&reply)) } -pub fn put( - ipfs: &Ipfs, -) -> impl Filter + Clone { - path!("dag" / "put") - .and(with_ipfs(ipfs)) - .and(query::()) - .and(warp::header::("content-type")) // TODO: rejects if missing - .and(warp::body::stream()) - .and_then(put_query) -} - /// Per https://docs-beta.ipfs.io/reference/http/api/#api-v0-block-resolve this endpoint takes in a /// path and resolves it to the last block (the cid), and to the path inside the final block /// (rempath).