simplify RefInfo fmt (#7929)
This commit is contained in:
parent
684322cd6f
commit
d6d6a7cc95
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
//! Disk-backed `HashDB` implementation.
|
//! Disk-backed `HashDB` implementation.
|
||||||
|
|
||||||
use std::fmt;
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::collections::hash_map::Entry;
|
use std::collections::hash_map::Entry;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@ -32,7 +31,7 @@ use ethereum_types::H256;
|
|||||||
use error::{BaseDataError, UtilError};
|
use error::{BaseDataError, UtilError};
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
struct RefInfo {
|
struct RefInfo {
|
||||||
queue_refs: usize,
|
queue_refs: usize,
|
||||||
in_archive: bool,
|
in_archive: bool,
|
||||||
@ -42,18 +41,6 @@ impl HeapSizeOf for RefInfo {
|
|||||||
fn heap_size_of_children(&self) -> usize { 0 }
|
fn heap_size_of_children(&self) -> usize { 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for RefInfo {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
write!(f, "{}+{}", self.queue_refs, if self.in_archive {1} else {0})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Debug for RefInfo {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
write!(f, "{}+{}", self.queue_refs, if self.in_archive {1} else {0})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
enum RemoveFrom {
|
enum RemoveFrom {
|
||||||
Queue,
|
Queue,
|
||||||
|
Loading…
Reference in New Issue
Block a user