aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/remote_filesystem.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-21 17:02:52 +0900
committernsfisis <nsfisis@gmail.com>2026-06-21 17:12:37 +0900
commit84fe6ac6977f15cbec85cbc9f773567742a7fb87 (patch)
tree5701e7c980585dd404471ab9fa53e98a0ba601ab /crates/shirabe/src/util/remote_filesystem.rs
parent12a7756588a20f1351e6976f0c009de5992514a9 (diff)
downloadphp-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.tar.gz
php-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.tar.zst
php-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.zip
refactor(math): use method-style max/min/clamp over std::cmp
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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