Commit 16a2c17
committed
fix(protocol): use variant ordering instead of Equal for incomparable Value types
The Ord impl for Value was returning Ordering::Equal for cross-type
comparisons (e.g. Date vs unparsable String, or any mismatched types).
This violated the Ord contract since PartialEq correctly returned false
for these pairs. Using Equal when values aren't equal breaks BTreeMaps,
sorting stability, and deduplication.
Now falls back to comparing variant discriminants, which gives a
consistent total order without falsely claiming equality.
https://claude.ai/code/session_01MYGPgMX6xJmjz7g27bsMcD1 parent 05f3673 commit 16a2c17
1 file changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
44 | 67 | | |
45 | 68 | | |
46 | 69 | | |
| |||
221 | 244 | | |
222 | 245 | | |
223 | 246 | | |
224 | | - | |
| 247 | + | |
225 | 248 | | |
226 | 249 | | |
227 | | - | |
| 250 | + | |
228 | 251 | | |
229 | 252 | | |
230 | 253 | | |
| |||
0 commit comments