chore: cargo fmt

This commit is contained in:
Joonas Koivunen 2020-04-16 15:16:50 +03:00 committed by Joonas Koivunen
parent 1ea02418a5
commit 4269887cb2
2 changed files with 4 additions and 20 deletions

View File

@ -50,22 +50,14 @@ async fn put_query<T: IpfsTypes>(
query: PutQuery,
mut form: multipart::FormData,
) -> Result<impl Reply, Rejection> {
let format = match query
.format
.as_deref()
.unwrap_or("dag-pb")
{
let format = match query.format.as_deref().unwrap_or("dag-pb") {
"dag-cbor" => Codec::DagCBOR,
"dag-pb" => Codec::DagProtobuf,
"dag-json" => Codec::DagJSON,
"raw" => Codec::Raw,
_ => return Err(StringError::from("unknown codec").into()),
};
let hasher = match query
.mhtype
.as_deref()
.unwrap_or("sha2-256")
{
let hasher = match query.mhtype.as_deref().unwrap_or("sha2-256") {
"sha2-256" => multihash::Sha2_256::digest,
"sha2-512" => multihash::Sha2_512::digest,
_ => return Err(StringError::from("unknown hash").into()),

View File

@ -17,22 +17,14 @@ async fn put_query<T: IpfsTypes>(
query: PutQuery,
mut form: multipart::FormData,
) -> Result<impl Reply, Rejection> {
let format = match query
.format
.as_deref()
.unwrap_or("dag-cbor")
{
let format = match query.format.as_deref().unwrap_or("dag-cbor") {
"dag-cbor" => Codec::DagCBOR,
"dag-pb" => Codec::DagProtobuf,
"dag-json" => Codec::DagJSON,
"raw" => Codec::Raw,
_ => return Err(StringError::from("unknown codec").into()),
};
let hasher = match query
.hash_alg
.as_deref()
.unwrap_or("sha2-256")
{
let hasher = match query.hash_alg.as_deref().unwrap_or("sha2-256") {
"sha2-256" => multihash::Sha2_256::digest,
"sha2-512" => multihash::Sha2_512::digest,
"sha3-512" => multihash::Sha3_512::digest,