feat: PartialEq on the config types, and pin the public trait impls
`Rating` already derived `PartialEq`, but that derive is only reachable through `D: PartialEq` — and `ConstantDrift`, the crate's own only `Drift` impl, did not satisfy it. So the derive was there and unusable. Found by writing the comparison from a consumer's position rather than reading the derive list. `ConstantDrift`, `ConvergenceOptions` and `GameOptions` now derive `PartialEq`. All three are pure configuration; comparing two is the natural thing to want and nothing about them makes equality ambiguous. `tests/trait_impls.rs` pins the surface, written the way the failure was reported: a consumer struct that *holds* a `History` and derives `Debug`. It also asserts `History`'s `Debug` summarises rather than dumping its skill stores, so a future derive cannot quietly replace the hand-written impl. `Clone` on `History` stays off. It is a decision, not an omission: a history owns every slice's skill store and arena, so cloning one is proportional to the whole fit, and no consumer has wanted it. Closes #76. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hcFjNDmHXZF8URGLku5zZ
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ use std::time::Duration;
|
||||
|
||||
use smallvec::SmallVec;
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub struct ConvergenceOptions {
|
||||
pub max_iter: usize,
|
||||
pub epsilon: f64,
|
||||
|
||||
Reference in New Issue
Block a user