This is an automated email from the ASF dual-hosted git repository.

Xuanwo pushed a commit to branch xuanwo/managed-length-preparation
in repository https://gitbox.apache.org/repos/asf/opendal-yinyang.git


The following commit(s) were added to 
refs/heads/xuanwo/managed-length-preparation by this push:
     new 65505c6  fix: satisfy managed update lint
65505c6 is described below

commit 65505c65db0597b065fa0ac12e3ddac8290f689f
Author: Xuanwo <[email protected]>
AuthorDate: Sat Oct 31 03:30:02 2026 +0800

    fix: satisfy managed update lint
    
    Use the standard multiple-of predicate and release the test backend guard 
before asynchronous checks.
    
    Co-authored-by: Psiace <[email protected]>
---
 crates/core/src/data.rs | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/crates/core/src/data.rs b/crates/core/src/data.rs
index 1ddbf33..b5b56d9 100644
--- a/crates/core/src/data.rs
+++ b/crates/core/src/data.rs
@@ -222,10 +222,10 @@ pub fn update_work_units(
         return None;
     }
     let mut units = 
leaves(final_length).saturating_sub(leaves(preserved_prefix));
-    if preserved_prefix != 0 && preserved_prefix % BLOCK_BYTES as u64 != 0 {
+    if preserved_prefix != 0 && !preserved_prefix.is_multiple_of(BLOCK_BYTES 
as u64) {
         units = units.saturating_add(1);
     }
-    if final_length != 0 && final_length % BLOCK_BYTES as u64 != 0 {
+    if final_length != 0 && !final_length.is_multiple_of(BLOCK_BYTES as u64) {
         units = units.saturating_add(1);
     }
     let mut nonempty = edits
@@ -1920,10 +1920,11 @@ mod tests {
                 .kind(),
             crate::ErrorKind::Unsupported
         );
-        let state = backend.state.lock().unwrap();
-        assert_eq!(state.data_reads, 0);
-        assert_eq!(state.written_bytes, 0);
-        drop(state);
+        {
+            let state = backend.state.lock().unwrap();
+            assert_eq!(state.data_reads, 0);
+            assert_eq!(state.written_bytes, 0);
+        }
 
         let impostor = DataStore::new(backend.operator(), filesystem).unwrap();
         assert_eq!(

Reply via email to