Skip to content

Commit

Permalink
Updates related to rustc 1.83.0 (#688)
Browse files Browse the repository at this point in the history
* clippy lints
* respect cargo-valgrind's Cargo.lock
  • Loading branch information
molpopgen authored Dec 11, 2024
1 parent 598f8df commit 3bce55a
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
os: [ubuntu-latest]
rust:
- stable
- 1.82.0
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand All @@ -34,7 +34,7 @@ jobs:
- run: sudo apt-get install -y valgrind
if: matrix.os == 'ubuntu-latest'
- run: cargo install cargo-valgrind
- name: run cargo valgrind
- name: run cargo valgrind --locked
run: |
cargo valgrind test --all-targets --all-features
- name: run cargo valgrind on doc tests
Expand Down
2 changes: 1 addition & 1 deletion src/edge_differences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub type EdgeInsertion = EdgeDifference<Insertion>;
/// Type alias for [`EdgeDifference<Removal>`]
pub type EdgeRemoval = EdgeDifference<Removal>;

impl<'a, T> Iterator for EdgeDifferences<'a, T>
impl<T> Iterator for EdgeDifferences<'_, T>
where
T: private::EdgeDifferenceIteration,
{
Expand Down
10 changes: 5 additions & 5 deletions src/edge_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn make_edge_table_row(table: &EdgeTable, pos: tsk_id_t) -> Option<EdgeTableRow>
pub(crate) type EdgeTableRefIterator<'a> = crate::table_iterator::TableIterator<&'a EdgeTable>;
pub(crate) type EdgeTableIterator = crate::table_iterator::TableIterator<EdgeTable>;

impl<'a> Iterator for EdgeTableRefIterator<'a> {
impl Iterator for EdgeTableRefIterator<'_> {
type Item = EdgeTableRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -89,7 +89,7 @@ impl<'a> EdgeTableRowView<'a> {
}
}

impl<'a> PartialEq for EdgeTableRowView<'a> {
impl PartialEq for EdgeTableRowView<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
&& self.parent == other.parent
Expand All @@ -100,9 +100,9 @@ impl<'a> PartialEq for EdgeTableRowView<'a> {
}
}

impl<'a> Eq for EdgeTableRowView<'a> {}
impl Eq for EdgeTableRowView<'_> {}

impl<'a> PartialEq<EdgeTableRow> for EdgeTableRowView<'a> {
impl PartialEq<EdgeTableRow> for EdgeTableRowView<'_> {
fn eq(&self, other: &EdgeTableRow) -> bool {
self.id == other.id
&& self.parent == other.parent
Expand All @@ -124,7 +124,7 @@ impl PartialEq<EdgeTableRowView<'_>> for EdgeTableRow {
}
}

impl<'a> streaming_iterator::StreamingIterator for EdgeTableRowView<'a> {
impl streaming_iterator::StreamingIterator for EdgeTableRowView<'_> {
type Item = Self;

row_lending_iterator_get!();
Expand Down
10 changes: 5 additions & 5 deletions src/individual_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<'a> IndividualTableRowView<'a> {
}
}

impl<'a> PartialEq for IndividualTableRowView<'a> {
impl PartialEq for IndividualTableRowView<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
&& self.flags == other.flags
Expand All @@ -60,9 +60,9 @@ impl<'a> PartialEq for IndividualTableRowView<'a> {
}
}

impl<'a> Eq for IndividualTableRowView<'a> {}
impl Eq for IndividualTableRowView<'_> {}

impl<'a> PartialEq<IndividualTableRow> for IndividualTableRowView<'a> {
impl PartialEq<IndividualTableRow> for IndividualTableRowView<'_> {
fn eq(&self, other: &IndividualTableRow) -> bool {
self.id == other.id
&& self.flags == other.flags
Expand All @@ -82,7 +82,7 @@ impl PartialEq<IndividualTableRowView<'_>> for IndividualTableRow {
}
}

impl<'a> streaming_iterator::StreamingIterator for IndividualTableRowView<'a> {
impl streaming_iterator::StreamingIterator for IndividualTableRowView<'_> {
type Item = Self;

row_lending_iterator_get!();
Expand Down Expand Up @@ -162,7 +162,7 @@ pub(crate) type IndividualTableRefIterator<'a> =
crate::table_iterator::TableIterator<&'a IndividualTable>;
pub(crate) type IndividualTableIterator = crate::table_iterator::TableIterator<IndividualTable>;

impl<'a> Iterator for IndividualTableRefIterator<'a> {
impl Iterator for IndividualTableRefIterator<'_> {
type Item = IndividualTableRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
10 changes: 5 additions & 5 deletions src/migration_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub(crate) type MigrationTableRefIterator<'a> =
crate::table_iterator::TableIterator<&'a MigrationTable>;
pub(crate) type MigrationTableIterator = crate::table_iterator::TableIterator<MigrationTable>;

impl<'a> Iterator for MigrationTableRefIterator<'a> {
impl Iterator for MigrationTableRefIterator<'_> {
type Item = MigrationTableRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -101,7 +101,7 @@ impl<'a> MigrationTableRowView<'a> {
}
}

impl<'a> PartialEq for MigrationTableRowView<'a> {
impl PartialEq for MigrationTableRowView<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
&& self.node == other.node
Expand All @@ -114,9 +114,9 @@ impl<'a> PartialEq for MigrationTableRowView<'a> {
}
}

impl<'a> Eq for MigrationTableRowView<'a> {}
impl Eq for MigrationTableRowView<'_> {}

impl<'a> PartialEq<MigrationTableRow> for MigrationTableRowView<'a> {
impl PartialEq<MigrationTableRow> for MigrationTableRowView<'_> {
fn eq(&self, other: &MigrationTableRow) -> bool {
self.id == other.id
&& self.node == other.node
Expand All @@ -142,7 +142,7 @@ impl PartialEq<MigrationTableRowView<'_>> for MigrationTableRow {
}
}

impl<'a> streaming_iterator::StreamingIterator for MigrationTableRowView<'a> {
impl streaming_iterator::StreamingIterator for MigrationTableRowView<'_> {
type Item = Self;

row_lending_iterator_get!();
Expand Down
10 changes: 5 additions & 5 deletions src/mutation_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub(crate) type MutationTableRefIterator<'a> =
crate::table_iterator::TableIterator<&'a MutationTable>;
pub(crate) type MutationTableIterator = crate::table_iterator::TableIterator<MutationTable>;

impl<'a> Iterator for MutationTableRefIterator<'a> {
impl Iterator for MutationTableRefIterator<'_> {
type Item = MutationTableRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -102,7 +102,7 @@ impl<'a> MutationTableRowView<'a> {
}
}

impl<'a> PartialEq for MutationTableRowView<'a> {
impl PartialEq for MutationTableRowView<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
&& self.site == other.site
Expand All @@ -114,9 +114,9 @@ impl<'a> PartialEq for MutationTableRowView<'a> {
}
}

impl<'a> Eq for MutationTableRowView<'a> {}
impl Eq for MutationTableRowView<'_> {}

impl<'a> PartialEq<MutationTableRow> for MutationTableRowView<'a> {
impl PartialEq<MutationTableRow> for MutationTableRowView<'_> {
fn eq(&self, other: &MutationTableRow) -> bool {
self.id == other.id
&& self.site == other.site
Expand All @@ -140,7 +140,7 @@ impl PartialEq<MutationTableRowView<'_>> for MutationTableRow {
}
}

impl<'a> streaming_iterator::StreamingIterator for MutationTableRowView<'a> {
impl streaming_iterator::StreamingIterator for MutationTableRowView<'_> {
type Item = Self;

row_lending_iterator_get!();
Expand Down
10 changes: 5 additions & 5 deletions src/node_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn make_node_table_row(table: &NodeTable, pos: tsk_id_t) -> Option<NodeTableRow>
pub(crate) type NodeTableRefIterator<'a> = crate::table_iterator::TableIterator<&'a NodeTable>;
pub(crate) type NodeTableIterator = crate::table_iterator::TableIterator<NodeTable>;

impl<'a> Iterator for NodeTableRefIterator<'a> {
impl Iterator for NodeTableRefIterator<'_> {
type Item = NodeTableRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -90,7 +90,7 @@ impl<'a> NodeTableRowView<'a> {
}
}

impl<'a> PartialEq for NodeTableRowView<'a> {
impl PartialEq for NodeTableRowView<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
&& self.flags == other.flags
Expand All @@ -101,9 +101,9 @@ impl<'a> PartialEq for NodeTableRowView<'a> {
}
}

impl<'a> Eq for NodeTableRowView<'a> {}
impl Eq for NodeTableRowView<'_> {}

impl<'a> PartialEq<NodeTableRow> for NodeTableRowView<'a> {
impl PartialEq<NodeTableRow> for NodeTableRowView<'_> {
fn eq(&self, other: &NodeTableRow) -> bool {
self.id == other.id
&& self.flags == other.flags
Expand All @@ -125,7 +125,7 @@ impl PartialEq<NodeTableRowView<'_>> for NodeTableRow {
}
}

impl<'a> streaming_iterator::StreamingIterator for NodeTableRowView<'a> {
impl streaming_iterator::StreamingIterator for NodeTableRowView<'_> {
type Item = Self;

row_lending_iterator_get!();
Expand Down
10 changes: 5 additions & 5 deletions src/population_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub(crate) type PopulationTableRefIterator<'a> =
crate::table_iterator::TableIterator<&'a PopulationTable>;
pub(crate) type PopulationTableIterator = crate::table_iterator::TableIterator<PopulationTable>;

impl<'a> Iterator for PopulationTableRefIterator<'a> {
impl Iterator for PopulationTableRefIterator<'_> {
type Item = PopulationTableRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -75,15 +75,15 @@ impl<'a> PopulationTableRowView<'a> {
}
}

impl<'a> PartialEq for PopulationTableRowView<'a> {
impl PartialEq for PopulationTableRowView<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id && self.metadata == other.metadata
}
}

impl<'a> Eq for PopulationTableRowView<'a> {}
impl Eq for PopulationTableRowView<'_> {}

impl<'a> PartialEq<PopulationTableRow> for PopulationTableRowView<'a> {
impl PartialEq<PopulationTableRow> for PopulationTableRowView<'_> {
fn eq(&self, other: &PopulationTableRow) -> bool {
self.id == other.id && optional_container_comparison!(self.metadata, other.metadata)
}
Expand All @@ -95,7 +95,7 @@ impl PartialEq<PopulationTableRowView<'_>> for PopulationTableRow {
}
}

impl<'a> streaming_iterator::StreamingIterator for PopulationTableRowView<'a> {
impl streaming_iterator::StreamingIterator for PopulationTableRowView<'_> {
type Item = Self;

row_lending_iterator_get!();
Expand Down
8 changes: 4 additions & 4 deletions src/provenance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn make_provenance_row(table: &ProvenanceTable, pos: tsk_id_t) -> Option<Provena
type ProvenanceTableRefIterator<'a> = crate::table_iterator::TableIterator<&'a ProvenanceTable>;
type ProvenanceTableIterator = crate::table_iterator::TableIterator<ProvenanceTable>;

impl<'a> Iterator for ProvenanceTableRefIterator<'a> {
impl Iterator for ProvenanceTableRefIterator<'_> {
type Item = ProvenanceTableRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -96,15 +96,15 @@ impl<'a> ProvenanceTableRowView<'a> {
}
}

impl<'a> PartialEq for ProvenanceTableRowView<'a> {
impl PartialEq for ProvenanceTableRowView<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id && self.timestamp == other.timestamp && self.record == other.record
}
}

impl Eq for ProvenanceTableRowView<'_> {}

impl<'a> PartialEq<ProvenanceTableRow> for ProvenanceTableRowView<'a> {
impl PartialEq<ProvenanceTableRow> for ProvenanceTableRowView<'_> {
fn eq(&self, other: &ProvenanceTableRow) -> bool {
self.id == other.id && self.timestamp == other.timestamp && self.record == other.record
}
Expand All @@ -116,7 +116,7 @@ impl PartialEq<ProvenanceTableRowView<'_>> for ProvenanceTableRow {
}
}

impl<'a> streaming_iterator::StreamingIterator for ProvenanceTableRowView<'a> {
impl streaming_iterator::StreamingIterator for ProvenanceTableRowView<'_> {
type Item = Self;

row_lending_iterator_get!();
Expand Down
10 changes: 5 additions & 5 deletions src/site_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn make_site_table_row(table: &SiteTable, pos: tsk_id_t) -> Option<SiteTableRow>
pub(crate) type SiteTableRefIterator<'a> = crate::table_iterator::TableIterator<&'a SiteTable>;
pub(crate) type SiteTableIterator = crate::table_iterator::TableIterator<SiteTable>;

impl<'a> Iterator for SiteTableRefIterator<'a> {
impl Iterator for SiteTableRefIterator<'_> {
type Item = SiteTableRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -80,7 +80,7 @@ impl<'a> SiteTableRowView<'a> {
}
}

impl<'a> PartialEq for SiteTableRowView<'a> {
impl PartialEq for SiteTableRowView<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
&& crate::util::partial_cmp_equal(&self.position, &other.position)
Expand All @@ -89,9 +89,9 @@ impl<'a> PartialEq for SiteTableRowView<'a> {
}
}

impl<'a> Eq for SiteTableRowView<'a> {}
impl Eq for SiteTableRowView<'_> {}

impl<'a> PartialEq<SiteTableRow> for SiteTableRowView<'a> {
impl PartialEq<SiteTableRow> for SiteTableRowView<'_> {
fn eq(&self, other: &SiteTableRow) -> bool {
self.id == other.id
&& crate::util::partial_cmp_equal(&self.position, &other.position)
Expand All @@ -109,7 +109,7 @@ impl PartialEq<SiteTableRowView<'_>> for SiteTableRow {
}
}

impl<'a> streaming_iterator::StreamingIterator for SiteTableRowView<'a> {
impl streaming_iterator::StreamingIterator for SiteTableRowView<'_> {
type Item = Self;

row_lending_iterator_get!();
Expand Down
10 changes: 5 additions & 5 deletions src/tree_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ impl TreeInterface {
}
}

/// Return the [`crate::NodeTable`] for this current tree
/// (and the tree sequence from which it came).
///
/// This is a convenience function for accessing node times, etc..
// /// Return the [`crate::NodeTable`] for this current tree
// /// (and the tree sequence from which it came).
// ///
// /// This is a convenience function for accessing node times, etc..
// fn node_table(&self) -> &crate::NodeTable {
// &self.nodes
// }
Expand Down Expand Up @@ -664,7 +664,7 @@ impl<'a> PostorderNodeIterator<'a> {
}
}

impl<'a> Iterator for PostorderNodeIterator<'a> {
impl Iterator for PostorderNodeIterator<'_> {
type Item = NodeId;
fn next(&mut self) -> Option<Self::Item> {
match self.current_node_index < self.num_nodes_current_tree {
Expand Down
6 changes: 3 additions & 3 deletions src/trees/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ pub struct Tree<'treeseq> {
advanced: i32,
}

impl<'treeseq> Deref for Tree<'treeseq> {
impl Deref for Tree<'_> {
type Target = TreeInterface;
fn deref(&self) -> &Self::Target {
&self.api
}
}

impl<'treeseq> DerefMut for Tree<'treeseq> {
impl DerefMut for Tree<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.api
}
Expand Down Expand Up @@ -106,7 +106,7 @@ impl<'ts> streaming_iterator::StreamingIterator for Tree<'ts> {
}
}

impl<'ts> streaming_iterator::DoubleEndedStreamingIterator for Tree<'ts> {
impl streaming_iterator::DoubleEndedStreamingIterator for Tree<'_> {
fn advance_back(&mut self) {
assert!(!self.as_ptr().is_null());
// SAFETY: pointer is not null.
Expand Down

0 comments on commit 3bce55a

Please sign in to comment.