1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

dd: implement Add for WriteStat

This commit is contained in:
Jeffrey Finkelstein 2023-03-17 22:41:10 -04:00 committed by jfinkels
parent 5142f35f83
commit b383e60998

View file

@ -379,6 +379,17 @@ impl std::ops::AddAssign for WriteStat {
}
}
impl std::ops::Add for WriteStat {
type Output = Self;
fn add(self, other: Self) -> Self {
Self {
writes_complete: self.writes_complete + other.writes_complete,
writes_partial: self.writes_partial + other.writes_partial,
bytes_total: self.bytes_total + other.bytes_total,
}
}
}
/// How much detail to report when printing transfer statistics.
///
/// This corresponds to the available settings of the `status`