Skip to content

Commit 4ba44ef

Browse files
authored
Bump editions to 2021. (#198)
* Bump tskit-derive version to 0.2.0 to match edition change. * Update to new 2021 prelude Closes #193
1 parent c4cc6e8 commit 4ba44ef

File tree

14 files changed

+8
-24
lines changed

14 files changed

+8
-24
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "tskit"
33
version = "0.6.1"
44
authors = ["tskit developers <[email protected]>"]
55
build = "build.rs"
6-
edition = "2018"
6+
edition = "2021"
77
description = "rust interface to tskit"
88
license = "MIT"
99
homepage = "https://github.com/tskit-dev/tskit-rust"
@@ -24,7 +24,7 @@ humantime = {version = "2.1.0", optional = true}
2424
serde = {version = "1.0.118", features = ["derive"], optional = true}
2525
serde_json = {version = "1.0.67", optional = true}
2626
bincode = {version = "1.3.1", optional = true}
27-
tskit-derive = {version = "0.1.0", path = "tskit-derive", optional = true}
27+
tskit-derive = {version = "0.2.0", path = "tskit-derive", optional = true}
2828

2929
[dev-dependencies]
3030
clap = "~2.34.0"

src/_macros.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ macro_rules! unsafe_tsk_column_access {
4646

4747
macro_rules! unsafe_tsk_ragged_column_access {
4848
($i: expr, $lo: expr, $hi: expr, $array: expr, $offset_array: expr, $offset_array_len: expr) => {{
49-
use std::convert::TryFrom;
5049
let i = crate::SizeType::try_from($i)?;
5150
if $i < $lo || i >= $hi {
5251
Err(TskitError::IndexError {})
@@ -72,7 +71,6 @@ macro_rules! unsafe_tsk_ragged_column_access {
7271
}};
7372

7473
($i: expr, $lo: expr, $hi: expr, $array: expr, $offset_array: expr, $offset_array_len: expr, $output_id_type: expr) => {{
75-
use std::convert::TryFrom;
7674
let i = crate::SizeType::try_from($i)?;
7775
if $i < $lo || i >= $hi {
7876
Err(TskitError::IndexError {})
@@ -103,7 +101,6 @@ macro_rules! unsafe_tsk_ragged_column_access {
103101
#[allow(unused_macros)]
104102
macro_rules! unsafe_tsk_ragged_char_column_access {
105103
($i: expr, $lo: expr, $hi: expr, $array: expr, $offset_array: expr, $offset_array_len: expr) => {{
106-
use std::convert::TryFrom;
107104
let i = crate::SizeType::try_from($i)?;
108105
if $i < $lo || i >= $hi {
109106
Err(TskitError::IndexError {})
@@ -305,7 +302,7 @@ macro_rules! impl_id_traits {
305302
}
306303
}
307304

308-
impl std::convert::TryFrom<$idtype> for crate::SizeType {
305+
impl TryFrom<$idtype> for crate::SizeType {
309306
type Error = crate::TskitError;
310307

311308
fn try_from(value: $idtype) -> Result<Self, Self::Error> {

src/edge_table.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ impl PartialEq for EdgeTableRow {
2525
}
2626

2727
fn make_edge_table_row(table: &EdgeTable, pos: tsk_id_t) -> Option<EdgeTableRow> {
28-
use std::convert::TryFrom;
2928
// panic is okay here, as we are handling a bad
3029
// input value before we first call this to
3130
// set up the iterator

src/individual_table.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub struct IndividualTable<'a> {
4949
}
5050

5151
fn make_individual_table_row(table: &IndividualTable, pos: tsk_id_t) -> Option<IndividualTableRow> {
52-
use std::convert::TryFrom;
5352
// panic is okay here, as we are handling a bad
5453
// input value before we first call this to
5554
// set up the iterator

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl From<usize> for SizeType {
286286
}
287287
}
288288

289-
impl std::convert::TryFrom<tsk_id_t> for SizeType {
289+
impl TryFrom<tsk_id_t> for SizeType {
290290
type Error = crate::TskitError;
291291

292292
fn try_from(value: tsk_id_t) -> Result<Self, Self::Error> {
@@ -297,7 +297,7 @@ impl std::convert::TryFrom<tsk_id_t> for SizeType {
297297
}
298298
}
299299

300-
impl std::convert::TryFrom<SizeType> for tsk_id_t {
300+
impl TryFrom<SizeType> for tsk_id_t {
301301
type Error = crate::TskitError;
302302

303303
fn try_from(value: SizeType) -> Result<Self, Self::Error> {

src/metadata.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ mod tests {
313313
Ok(rv)
314314
}
315315
fn decode(md: &[u8]) -> Result<Self, MetadataError> {
316-
use std::convert::TryInto;
317316
let (x_int_bytes, rest) = md.split_at(std::mem::size_of::<i32>());
318317
let (y_int_bytes, _) = rest.split_at(std::mem::size_of::<u32>());
319318
Ok(Self {

src/migration_table.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ impl PartialEq for MigrationTableRow {
3030
}
3131

3232
fn make_migration_table_row(table: &MigrationTable, pos: tsk_id_t) -> Option<MigrationTableRow> {
33-
use std::convert::TryFrom;
3433
// panic is okay here, as we are handling a bad
3534
// input value before we first call this to
3635
// set up the iterator

src/mutation_table.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ impl PartialEq for MutationTableRow {
2828
}
2929

3030
fn make_mutation_table_row(table: &MutationTable, pos: tsk_id_t) -> Option<MutationTableRow> {
31-
use std::convert::TryFrom;
3231
// panic is okay here, as we are handling a bad
3332
// input value before we first call this to
3433
// set up the iterator

src/node_table.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ impl PartialEq for NodeTableRow {
2626
}
2727

2828
fn make_node_table_row(table: &NodeTable, pos: tsk_id_t) -> Option<NodeTableRow> {
29-
use std::convert::TryFrom;
3029
// panic is okay here, as we are handling a bad
3130
// input value before we first call this to
3231
// set up the iterator

src/population_table.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ impl PartialEq for PopulationTableRow {
1919
}
2020

2121
fn make_population_table_row(table: &PopulationTable, pos: tsk_id_t) -> Option<PopulationTableRow> {
22-
use std::convert::TryFrom;
2322
// panic is okay here, as we are handling a bad
2423
// input value before we first call this to
2524
// set up the iterator

0 commit comments

Comments
 (0)