Skip to content

Commit

Permalink
new trait
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Jul 11, 2024
1 parent d8c4bce commit ad06d6f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ pub trait TableAccess {
fn migrations(&self) -> &crate::MigrationTable;
}

pub trait TableIteration: TableAccess {

Check warning on line 131 in src/traits.rs

View workflow job for this annotation

GitHub Actions / Test (Miri)

trait `TableIteration` is never used

Check warning on line 131 in src/traits.rs

View workflow job for this annotation

GitHub Actions / Test (Miri)

trait `TableIteration` is never used
fn edges_iter(&self) -> impl Iterator<Item = crate::EdgeTableRow> + '_ {
self.edges().iter()
}
}

impl TableAccess for crate::TableCollection {
fn edges(&self) -> &crate::EdgeTable {
self.edges()
Expand Down Expand Up @@ -171,3 +177,5 @@ impl TableAccess for crate::TreeSequence {
self.tables().migrations()
}
}

impl<T> TableIteration for T where T: TableAccess {}

0 comments on commit ad06d6f

Please sign in to comment.