Move FairnessConfig to fairness module and re-export#437
Conversation
Resolve a layering violation where FairnessConfig was defined in the connection module but consumed by the lower-level fairness module. The configuration type now lives in src/fairness.rs where it logically belongs, with a pub use re-export from src/connection/mod.rs preserving the existing public API surface. Closes #429 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewer's GuideRelocates FairnessConfig and its Default implementation from the connection module into the fairness module, updating fairness to depend directly on tokio::time::Duration while preserving the public API via a re-export from the connection module. Class diagram for relocated FairnessConfig in fairness moduleclassDiagram
class FairnessConfig {
+usize max_high_before_low
+Option_Duration_ time_slice
+FairnessConfig default()
}
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary by CodeRabbit
WalkthroughMove the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/fairness.rs`:
- Around line 10-23: The FairnessConfig struct lacks equality derivations,
making comparisons in tests and consumers harder; update the struct declaration
for FairnessConfig to also derive PartialEq and Eq (in addition to Clone, Copy,
Debug) so that FairnessConfig (and its fields max_high_before_low and
time_slice) can be compared for equality.
Add equality derivations to FairnessConfig to enable comparisons in tests and consumers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Changes
Core
src/connection/mod.rs.FairnessConfigstruct andDefaultimplementation tosrc/fairness.rs(in the fairness module).tokio::time::Duration(as part of the struct).src/connection/mod.rsre-exportsFairnessConfigviapub use crate::fairness::FairnessConfig;so downstream code can still access it ascrate::connection::FairnessConfig.API/Usage
crate::connection::FairnessConfig, now defined in the fairness module.Migration notes
Test plan
crate::connection::FairnessConfigis still accessible from downstream code.max_high_before_low = 8,time_slice = None.◳ Generated by DevBoxer ◰
ℹ️ Tag @devboxerhub to ask questions and address PR feedback
📎 Task: https://www.devboxer.com/task/c7e7d12e-5368-4e4d-9ad2-0cbbc425a5a5
📝 Closes #429
Summary by Sourcery
Enhancements: