refactor: reorder pub fn before inner impl
@@ -30,6 +30,17 @@ impl Default for InputEncoding {
}
}
+pub fn put<T: IpfsTypes>(
+ ipfs: &Ipfs<T>,
+) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
+ path!("dag" / "put")
+ .and(with_ipfs(ipfs))
+ .and(query::<PutQuery>())
+ .and(warp::header::<Mime>("content-type")) // TODO: rejects if missing
+ .and(warp::body::stream())
+ .and_then(put_query)
+}
+
async fn put_query<T: IpfsTypes>(
ipfs: Ipfs<T>,
query: PutQuery,
@@ -81,17 +92,6 @@ async fn put_query<T: IpfsTypes>(
Ok(reply::json(&reply))
}
-pub fn put<T: IpfsTypes>(
- ipfs: &Ipfs<T>,
-) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
- path!("dag" / "put")
- .and(with_ipfs(ipfs))
- .and(query::<PutQuery>())
- .and(warp::header::<Mime>("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).
