aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/remote_filesystem.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/util/remote_filesystem.rs')
-rw-r--r--crates/shirabe/src/util/remote_filesystem.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/shirabe/src/util/remote_filesystem.rs b/crates/shirabe/src/util/remote_filesystem.rs
index c4b3923..bada2af 100644
--- a/crates/shirabe/src/util/remote_filesystem.rs
+++ b/crates/shirabe/src/util/remote_filesystem.rs
@@ -778,10 +778,9 @@ impl RemoteFilesystem {
}
x if x == STREAM_NOTIFY_PROGRESS => {
if self.bytes_max > 0 && self.progress {
- let progression = std::cmp::min(
- 100_i64,
- ((bytes_transferred as f64 / self.bytes_max as f64) * 100.0).round() as i64,
- );
+ let progression = (((bytes_transferred as f64 / self.bytes_max as f64) * 100.0)
+ .round() as i64)
+ .min(100_i64);
if 0 == progression % 5
&& 100 != progression