From 84fe6ac6977f15cbec85cbc9f773567742a7fb87 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 21 Jun 2026 17:02:52 +0900 Subject: refactor(math): use method-style max/min/clamp over std::cmp Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/util/remote_filesystem.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/util/remote_filesystem.rs') 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 -- cgit v1.3.1