Skip to content

Commit

Permalink
Remove unnecessary mut modifiers in a test
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Aug 27, 2024
1 parent 9b73e20 commit b7f5392
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions src/engine/strat_engine/backstore/cache_tier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,17 +412,16 @@ mod tests {
// the tier.
let cache_metadata_size = cache_tier.meta_segments.size();

let mut metadata_size = cache_tier.block_mgr.sizer().metadata_size();
let mut size = cache_tier.block_mgr.sizer().size();
let mut allocated = cache_tier.cache_segments.size();
let metadata_size = cache_tier.block_mgr.sizer().metadata_size();
let size = cache_tier.block_mgr.sizer().size();

assert_eq!(
cache_tier.block_mgr.sizer().avail_space(),
BlockDevMgrAvailSpace(Sectors(0))
);
assert_eq!(
size.sectors() - metadata_size.sectors(),
allocated + cache_metadata_size
cache_tier.cache_segments.size() + cache_metadata_size
);

let (_, (cache, meta)) = cache_tier
Expand All @@ -442,12 +441,10 @@ mod tests {
cache_tier.block_mgr.sizer().metadata_size().sectors() > metadata_size.sectors()
);

metadata_size = cache_tier.block_mgr.sizer().metadata_size();
size = cache_tier.block_mgr.sizer().size();
allocated = cache_tier.cache_segments.size();
assert_eq!(
size.sectors() - metadata_size.sectors(),
allocated + cache_metadata_size
cache_tier.block_mgr.sizer().size().sectors()
- cache_tier.block_mgr.sizer().metadata_size().sectors(),
cache_tier.cache_segments.size() + cache_metadata_size
);

cache_tier.destroy().unwrap();
Expand Down Expand Up @@ -497,17 +494,16 @@ mod tests {
// the tier.
let cache_metadata_size = cache_tier.meta_segments.size();

let mut metadata_size = cache_tier.block_mgr.sizer().metadata_size();
let mut size = cache_tier.block_mgr.sizer().size();
let mut allocated = cache_tier.cache_segments.size();
let metadata_size = cache_tier.block_mgr.sizer().metadata_size();
let size = cache_tier.block_mgr.sizer().size();

assert_eq!(
cache_tier.block_mgr.sizer().avail_space(),
BlockDevMgrAvailSpace(Sectors(0))
);
assert_eq!(
size.sectors() - metadata_size.sectors(),
allocated + cache_metadata_size
cache_tier.cache_segments.size() + cache_metadata_size
);

let (_, (cache, meta)) = cache_tier.add(pool_uuid, devices2).unwrap();
Expand All @@ -525,12 +521,10 @@ mod tests {
cache_tier.block_mgr.sizer().metadata_size().sectors() > metadata_size.sectors()
);

metadata_size = cache_tier.block_mgr.sizer().metadata_size();
size = cache_tier.block_mgr.sizer().size();
allocated = cache_tier.cache_segments.size();
assert_eq!(
size.sectors() - metadata_size.sectors(),
allocated + cache_metadata_size
cache_tier.block_mgr.sizer().size().sectors()
- cache_tier.block_mgr.sizer().metadata_size().sectors(),
cache_tier.cache_segments.size() + cache_metadata_size
);

cache_tier.destroy().unwrap();
Expand Down

0 comments on commit b7f5392

Please sign in to comment.