Run fmt, fix dep route (#312)

This commit is contained in:
Geometrically
2022-02-27 21:44:00 -07:00
committed by GitHub
parent 725f8571bb
commit 459e36c027
53 changed files with 1798 additions and 867 deletions

View File

@@ -18,7 +18,9 @@ pub async fn read_from_payload(
return Err(ApiError::InvalidInputError(String::from(err_msg)));
} else {
bytes.extend_from_slice(&item.map_err(|_| {
ApiError::InvalidInputError("Unable to parse bytes in payload sent!".to_string())
ApiError::InvalidInputError(
"Unable to parse bytes in payload sent!".to_string(),
)
})?);
}
}
@@ -35,13 +37,17 @@ pub async fn read_from_field(
if bytes.len() >= cap {
return Err(CreateError::InvalidInput(String::from(err_msg)));
} else {
bytes.extend_from_slice(&chunk.map_err(CreateError::MultipartError)?);
bytes.extend_from_slice(
&chunk.map_err(CreateError::MultipartError)?,
);
}
}
Ok(bytes)
}
pub(crate) fn ok_or_not_found<T, U>(version_data: Option<T>) -> Result<HttpResponse, ApiError>
pub(crate) fn ok_or_not_found<T, U>(
version_data: Option<T>,
) -> Result<HttpResponse, ApiError>
where
U: From<T> + Serialize,
{