From 1e17e97a2458292aa494f4dc64456b5043c44dfc Mon Sep 17 00:00:00 2001 From: "Kevin R. Thornton" Date: Sat, 27 Jul 2024 12:50:30 -0700 Subject: [PATCH] style: fix lints from rust 1.80.0 (#650) * Also fix doc test markdown errors --- Cargo.toml | 3 +++ src/table_collection.rs | 8 ++++---- src/trees/treeseq.rs | 8 ++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5dd9867e..d919f0c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,9 @@ repository = "https://github.com/tskit-dev/tskit-rust" rust-version = "1.71.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints.rust] +# Added for rust 1.80.0 +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] } [profile.release] lto = "fat" diff --git a/src/table_collection.rs b/src/table_collection.rs index a8d1718d..bc0f1872 100644 --- a/src/table_collection.rs +++ b/src/table_collection.rs @@ -83,7 +83,7 @@ impl TableCollection { /// /// Negative sequence lengths are errors: /// - /// ```{should_panic} + /// ```should_panic /// let tables = tskit::TableCollection::new(-55.0).unwrap(); /// ``` pub fn new>(sequence_length: P) -> Result { @@ -1382,10 +1382,10 @@ impl TableCollection { /// # Return value /// - `Ok(None)`: when truncation leads to empty edge table. /// - `Ok(Some(TableCollection))`: when trunction is successfully performed - /// and results in non-empty edge table. The table collection is sorted. + /// and results in non-empty edge table. The table collection is sorted. /// - `Error(TskitError)`: Any errors from the C API propagate. An - /// [TskitError::RangeError] will occur when `intervals` are not - /// sorted. + /// [TskitError::RangeError] will occur when `intervals` are not + /// sorted. /// /// # Notes /// diff --git a/src/trees/treeseq.rs b/src/trees/treeseq.rs index 704442b2..9c761655 100644 --- a/src/trees/treeseq.rs +++ b/src/trees/treeseq.rs @@ -220,7 +220,7 @@ impl TreeSequence { /// /// A `Tree`'s lifetime is tied to that of its tree sequence: /// - /// ```{compile_fail} + /// ```compile_fail /// # use streaming_iterator::StreamingIterator; /// # use streaming_iterator::DoubleEndedStreamingIterator; /// # let mut tables = tskit::TableCollection::new(1000.).unwrap(); @@ -368,10 +368,10 @@ impl TreeSequence { /// # Return value /// - `Ok(None)`: when truncation leads to empty edge table. /// - `Ok(Some(TableCollection))`: when trunction is successfully performed - /// and results in non-empty edge table. The tables are sorted. + /// and results in non-empty edge table. The tables are sorted. /// - `Error(TskitError)`: Any errors from the C API propagate. An - /// [TskitError::RangeError] will occur when `intervals` are not - /// sorted. + /// [TskitError::RangeError] will occur when `intervals` are not + /// sorted. /// /// # Notes ///