Skip to content

Commit

Permalink
fixup! editoast: add comment about why code is written this way
Browse files Browse the repository at this point in the history
  • Loading branch information
woshilapin committed Jan 3, 2024
1 parent d4d0b51 commit 8d0cf43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions editoast/src/views/infra/auto_fixes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ fn fix_infra(
fixes = fixes_for_object_errors.into_iter().try_fold(
fixes,
|mut fixes, (object_ref, fix)| {
// cannot use `fixes.insert()` because we want to detect before inserting
// `Entry` doesn't have an API to return an error if key already exists
match fixes.entry(object_ref) {
Entry::Occupied(entry) => {
return Err(AutoFixesEditoastError::ConflictingFixesOnSameObject {
Expand Down

0 comments on commit 8d0cf43

Please sign in to comment.