We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Size
Num[Assign]
1 parent 240c713 commit 748e35dCopy full SHA for 748e35d
1 file changed
src/size.rs
@@ -9,6 +9,13 @@ use std::{
9
#[cfg(feature = "json")]
10
use serde::{Deserialize, Serialize};
11
12
+mod mul_traits {
13
+ use std::ops::{Mul, MulAssign};
14
+ pub trait MulAssignEx<Rhs>: Mul<Rhs, Output = Self> + MulAssign<Rhs> + Sized {}
15
+ impl<Lhs: Mul<Rhs, Output = Lhs> + MulAssign<Rhs>, Rhs> MulAssignEx<Rhs> for Lhs {}
16
+}
17
+use mul_traits::MulAssignEx;
18
+
19
/// Types whose values can be used as disk usage statistic.
20
pub trait Size:
21
Debug
@@ -22,6 +29,10 @@ pub trait Size:
22
29
+ Add<Output = Self>
23
30
+ AddAssign
24
31
+ Sum
32
+ + MulAssignEx<u8>
33
+ + MulAssignEx<u16>
34
+ + MulAssignEx<u32>
35
+ + MulAssignEx<u64>
25
36
{
26
37
/// Underlying type
27
38
type Inner: From<Self> + Into<Self> + Mul<Self, Output = Self>;
0 commit comments