Fix some clippy lints
This commit is contained in:
parent
08766dc0e0
commit
21a63a10a4
624
Cargo.lock
generated
624
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,7 @@ impl AppError {
|
||||
impl IntoResponse for AppError {
|
||||
fn into_response(self) -> Response {
|
||||
let status_code = match self {
|
||||
AppError::BadRequest(_) => StatusCode::BAD_REQUEST,
|
||||
_ => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
};
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ pub async fn insert(
|
||||
|
||||
for insertions in insertions.chunks(400) {
|
||||
let (new_or_updated_insertions, inserted_transaction_ids) =
|
||||
whittle_insertions(insertions, &db).await?;
|
||||
whittle_insertions(insertions, db).await?;
|
||||
|
||||
if new_or_updated_insertions.is_empty() {
|
||||
continue;
|
||||
@ -69,7 +69,7 @@ async fn update_expenditures(
|
||||
|
||||
expenditure::Entity::insert_many(
|
||||
new_or_updated_insertions
|
||||
.into_iter()
|
||||
.iter()
|
||||
.flat_map(|i| &i.contained_expenditures)
|
||||
.cloned(),
|
||||
)
|
||||
@ -127,7 +127,7 @@ async fn whittle_insertions<'a>(
|
||||
// We will only update those where the hash is different to avoid unnecessary updates and
|
||||
// notifications.
|
||||
let new_or_updated_insertions = insertions
|
||||
.into_iter()
|
||||
.iter()
|
||||
.filter(|i| {
|
||||
let hash = i.identity_hash;
|
||||
!existing_hashes
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
#[allow(dead_code)]
|
||||
mod headings {
|
||||
#[allow(unused_imports)]
|
||||
pub use super::super::ingestion_logic::headings::*;
|
||||
|
||||
// Additional FLex headings
|
||||
|
||||
@ -43,7 +43,7 @@ pub async fn monzo_batched_csv(
|
||||
Extension(db): Extension<DatabaseConnection>,
|
||||
multipart: Multipart,
|
||||
) -> Result<&'static str, AppError> {
|
||||
static CSV_MISSING_ERR_MSG: &'static str = "No CSV file provided. Expected a multipart request with a `csv` field containing the contents of the CSV.";
|
||||
static CSV_MISSING_ERR_MSG: &str = "No CSV file provided. Expected a multipart request with a `csv` field containing the contents of the CSV.";
|
||||
|
||||
let csv = extract_csv(multipart)
|
||||
.await
|
||||
|
||||
Loading…
Reference in New Issue
Block a user