Fix rustc & clippy warnings for nightly (2021-09-19) (#629)

Fix clippy warnings for nightly (2021-09-19)
This commit is contained in:
Max Sharnoff
2021-09-22 11:24:43 -07:00
committed by GitHub
parent 579b5ee944
commit 90ef661673
2 changed files with 5 additions and 19 deletions

View File

@@ -32,6 +32,7 @@ lazy_static! {
///
/// LayerMap tracks what layers exist on a timeline.
///
#[derive(Default)]
pub struct LayerMap {
/// All the layers keyed by segment tag
segs: HashMap<SegmentTag, SegEntry>,
@@ -46,16 +47,6 @@ pub struct LayerMap {
current_generation: u64,
}
impl Default for LayerMap {
fn default() -> Self {
LayerMap {
segs: HashMap::new(),
open_layers: BinaryHeap::new(),
current_generation: 0,
}
}
}
impl LayerMap {
///
/// Look up a layer using the given segment tag and LSN. This differs from a
@@ -231,20 +222,12 @@ impl LayerMap {
/// and is kept in a separate field, because there can be only one for
/// each segment. The older layers, stored on disk, are kept in a
/// BTreeMap keyed by the layer's start LSN.
#[derive(Default)]
struct SegEntry {
pub open: Option<Arc<InMemoryLayer>>,
pub historic: BTreeMap<Lsn, Arc<dyn Layer>>,
}
impl Default for SegEntry {
fn default() -> Self {
SegEntry {
open: None,
historic: BTreeMap::new(),
}
}
}
impl SegEntry {
/// Does the segment exist at given LSN?
/// Return None if object is not found in this SegEntry.

View File

@@ -360,6 +360,9 @@ fn find_wal_file_range(
///
/// [postgres docs]: https://www.postgresql.org/docs/current/protocol-replication.html
#[derive(Debug)]
// As of nightly 2021-09-11, fields that are only read by the type's `Debug` impl still count as
// unused. Relevant issue: https://github.com/rust-lang/rust/issues/88900
#[allow(dead_code)]
pub struct IdentifySystem {
systemid: u64,
timeline: u32,