Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions pageserver/src/layered_repository/layer_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions pageserver/src/walreceiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down