Skip to content

Commit

Permalink
Fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
andriidemus committed Jan 7, 2025
1 parent 69f318c commit 350b5c3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/utils/event-sourcing/src/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,16 @@ where
// When failed to read at least one event from source stream,
// function returns error result immediately
let (query, event_id, event) = res?;
let agg_result: Result<Aggregate<Proj, Store>, LoadError<Proj>> =
match agg_results.remove(&query) {
None => Self::from_stored_event(query.clone(), event_id, event)
.map_err(|err| err.into()),
Some(Ok(mut agg)) => match agg.apply_stored(event_id, event) {
Ok(_) => Ok(agg),
Err(err) => Err(err.into()),
},
Some(Err(err)) => Err(err),
};
let agg_result: Result<Aggregate<Proj, Store>, LoadError<Proj>> = match agg_results
.remove(&query)
{
None => Self::from_stored_event(query.clone(), event_id, event).map_err(Into::into),
Some(Ok(mut agg)) => match agg.apply_stored(event_id, event) {
Ok(_) => Ok(agg),
Err(err) => Err(err.into()),
},
Some(Err(err)) => Err(err),
};
agg_results.insert(query, agg_result);
}

Expand Down

0 comments on commit 350b5c3

Please sign in to comment.