Commit 7a6f363
committed
Remove checked_sum impl for Weight
The `Weight` type does not use `NumOpResult<Weight>` with addition,
`Add` has `Output = Weight` and uses wrapping addition. This is as
expected and as desired. We do provide `Weight::checked_add` that
returns an `Option<Weight>`, also as expected and as desired.
Further context: `Amount` was deemed 'special' such that wrapping is
considered to big a risk to have silent wrapping so we added the
`NumOpResult` type. This argument does not apply to `Weight`.
We would like to remove the `CheckedSum` trait because summing of
`Amounts` can now be done with a combination of`Sum` and the
`NumOpResult` type but `Weight` currently implements `CheckedSum`.
For the reasons outline in regards to wrapping a `Weight` type,
providing `CheckedSum` does not add much value - remove it.
Done as preparation for removing the `CheckedSum` trait all together.1 parent f7274a5 commit 7a6f363
1 file changed
+1
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | 254 | | |
262 | 255 | | |
263 | 256 | | |
| |||
541 | 534 | | |
542 | 535 | | |
543 | 536 | | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | 537 | | |
0 commit comments