Skip to content

perf!: change ValidationRuleContext to readonly struct#306

Merged
skwasjer merged 1 commit intomainfrom
feature/validation_rule_context
Sep 20, 2025
Merged

perf!: change ValidationRuleContext to readonly struct#306
skwasjer merged 1 commit intomainfrom
feature/validation_rule_context

Conversation

@skwasjer
Copy link
Owner

@skwasjer skwasjer commented Sep 20, 2025

  • no longer need null-reference checks
  • adds IEquatable<> which can help to make tests simpler
  • moves responsibility to set country code away from rule and makes ctx immutable
  • reduces heap allocations slightly (but very small)

It is however a breaking change.

@sonarqubecloud
Copy link

@skwasjer skwasjer added this to the v6.0 milestone Sep 20, 2025
@skwasjer skwasjer merged commit c7af611 into main Sep 20, 2025
13 checks passed
@skwasjer skwasjer deleted the feature/validation_rule_context branch September 20, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant