mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 21:15:45 +00:00
block: qcow: Fix beta clippy issue
warning: field `0` is never read --> block/src/qcow/vec_cache.rs:139:21 | 139 | struct NumCache(pub u64); | -------- ^^^^^^^ | | | field in this struct | = note: `#[warn(dead_code)]` on by default help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 139 | struct NumCache(()); | ~~ Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
parent
4e0dc5203a
commit
c19c73cb99
@ -136,7 +136,7 @@ impl<T: Cacheable> CacheMap<T> {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
struct NumCache(pub u64);
|
struct NumCache(());
|
||||||
impl Cacheable for NumCache {
|
impl Cacheable for NumCache {
|
||||||
fn dirty(&self) -> bool {
|
fn dirty(&self) -> bool {
|
||||||
true
|
true
|
||||||
@ -148,28 +148,28 @@ mod tests {
|
|||||||
let mut cache = CacheMap::<NumCache>::new(3);
|
let mut cache = CacheMap::<NumCache>::new(3);
|
||||||
let mut evicted = None;
|
let mut evicted = None;
|
||||||
cache
|
cache
|
||||||
.insert(0, NumCache(5), |index, _| {
|
.insert(0, NumCache(()), |index, _| {
|
||||||
evicted = Some(index);
|
evicted = Some(index);
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(evicted, None);
|
assert_eq!(evicted, None);
|
||||||
cache
|
cache
|
||||||
.insert(1, NumCache(6), |index, _| {
|
.insert(1, NumCache(()), |index, _| {
|
||||||
evicted = Some(index);
|
evicted = Some(index);
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(evicted, None);
|
assert_eq!(evicted, None);
|
||||||
cache
|
cache
|
||||||
.insert(2, NumCache(7), |index, _| {
|
.insert(2, NumCache(()), |index, _| {
|
||||||
evicted = Some(index);
|
evicted = Some(index);
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(evicted, None);
|
assert_eq!(evicted, None);
|
||||||
cache
|
cache
|
||||||
.insert(3, NumCache(8), |index, _| {
|
.insert(3, NumCache(()), |index, _| {
|
||||||
evicted = Some(index);
|
evicted = Some(index);
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user