Skip to content

Commit 80cdaad

Browse files
committed
*::metadata table functions require row ID types.
1 parent 52b0b9d commit 80cdaad

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/individual_table.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ impl<'a> IndividualTable<'a> {
132132
/// # Errors
133133
///
134134
/// * [`TskitError::IndexError`] if `row` is out of range.
135-
pub fn metadata<I: Into<IndividualId>, T: metadata::MetadataRoundtrip>(
135+
pub fn metadata<T: metadata::MetadataRoundtrip>(
136136
&'a self,
137-
row: I,
137+
row: IndividualId,
138138
) -> Result<Option<T>, TskitError> {
139-
let buffer = metadata_to_vector!(self, row.into().0)?;
139+
let buffer = metadata_to_vector!(self, row.0)?;
140140
decode_metadata_row!(T, buffer)
141141
}
142142

src/node_table.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ impl<'a> NodeTable<'a> {
159159
)
160160
}
161161

162-
pub fn metadata<N: Into<crate::NodeId>, T: metadata::MetadataRoundtrip>(
162+
pub fn metadata<T: metadata::MetadataRoundtrip>(
163163
&'a self,
164-
row: N,
164+
row: NodeId,
165165
) -> Result<Option<T>, TskitError> {
166-
let buffer = metadata_to_vector!(self, row.into().0)?;
166+
let buffer = metadata_to_vector!(self, row.0)?;
167167
decode_metadata_row!(T, buffer)
168168
}
169169

src/population_table.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ impl<'a> PopulationTable<'a> {
7272
self.table_.num_rows
7373
}
7474

75-
pub fn metadata<P: Into<PopulationId>, T: metadata::MetadataRoundtrip>(
75+
pub fn metadata<T: metadata::MetadataRoundtrip>(
7676
&'a self,
77-
row: P,
77+
row: PopulationId,
7878
) -> Result<Option<T>, TskitError> {
79-
let buffer = metadata_to_vector!(self, row.into().0)?;
79+
let buffer = metadata_to_vector!(self, row.0)?;
8080
decode_metadata_row!(T, buffer)
8181
}
8282

0 commit comments

Comments
 (0)