Skip to content

Commit b9f6fe3

Browse files
committed
style: deny broken intradoc links
* fix malformed doc test
1 parent 97909a6 commit b9f6fe3

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
#![allow(non_camel_case_types)]
7878
#![allow(non_snake_case)]
7979
#![cfg_attr(doc_cfg, feature(doc_cfg))]
80+
#![deny(rustdoc::broken_intra_doc_links)]
8081

8182
#[cfg(feature = "bindings")]
8283
pub use sys::bindings;

src/newtypes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub use crate::sys::newtypes::PopulationId;
9494

9595
/// A provenance ID
9696
///
97-
/// This is an integer referring to a row of a [``provenance::ProvenanceTable``].
97+
/// This is an integer referring to a row of a [``crate::provenance::ProvenanceTable``].
9898
///
9999
/// The features for this type follow the same pattern as for [``NodeId``]
100100
#[cfg(feature = "provenance")]

src/sys/flags.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,16 +295,17 @@ impl SimplificationOptions {
295295
/// # use tskit::TableClearOptions;
296296
/// let f = TableClearOptions::default().clear_provenance();
297297
/// assert_eq!(f, TableClearOptions::CLEAR_PROVENANCE);
298+
/// ```
298299
///
299300
/// ```
300301
/// # use tskit::TableClearOptions;
301302
/// let f = TableClearOptions::default().clear_metadata_schema().clear_ts_metadata_and_schema();
302303
/// assert!(f.contains(TableClearOptions::CLEAR_METADATA_SCHEMAS));
303304
/// assert!(f.contains(TableClearOptions::CLEAR_TS_METADATA_SCHEMA));
304-
/// let f = f.clear();
305-
/// assert!(f.contains(TableClearOptions::CLEAR_METADATA_SCHEMAS));
306-
/// assert!(f.contains(TableClearOptions::CLEAR_TS_METADATA_SCHEMA));
307-
/// assert!(f.contains(TableClearOptions::CLEAR_PROVENANCE);
305+
/// # let f = TableClearOptions::default();
306+
/// # assert!(!f.contains(TableClearOptions::CLEAR_METADATA_SCHEMAS));
307+
/// # assert!(!f.contains(TableClearOptions::CLEAR_TS_METADATA_SCHEMA));
308+
/// # assert!(!f.contains(TableClearOptions::CLEAR_PROVENANCE));
308309
/// ```
309310
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
310311
#[repr(transparent)]
@@ -438,7 +439,7 @@ impl TableSortOptions {
438439
contains!();
439440
}
440441

441-
/// Modify behavior of [`crate::TableCollection::sort_individuals`].
442+
/// Modify behavior of [`crate::TableCollection::topological_sort_individuals`].
442443
///
443444
/// # Examples
444445
///
@@ -458,8 +459,8 @@ impl IndividualTableSortOptions {
458459
contains!();
459460
}
460461

461-
/// Specify the behavior of iterating over [`Tree`] objects.
462-
/// See [`TreeSequence::tree_iterator`].
462+
/// Specify the behavior of iterating over [`crate::Tree`] objects.
463+
/// See [`crate::TreeSequence::tree_iterator`].
463464
///
464465
/// # Examples
465466
///
@@ -491,7 +492,7 @@ pub struct TreeFlags(RawFlags);
491492

492493
impl TreeFlags {
493494
make_constant_self!(
494-
/// Update sample lists, enabling [`Tree::samples`].
495+
/// Update sample lists, enabling [`crate::Tree::samples`].
495496
=> SAMPLE_LISTS,TSK_SAMPLE_LISTS);
496497
make_constant_self!(
497498
/// Do *not* update the number of samples descending

src/sys/tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,11 @@ impl NodeIterator for SamplesIterator<'_> {
488488

489489
#[non_exhaustive]
490490
pub enum NodeTraversalOrder {
491-
///Preorder traversal, starting at the root(s) of a [`TreeInterface`].
491+
///Preorder traversal, starting at the root(s) of a tree.
492492
///For trees with multiple roots, start at the left root,
493493
///traverse to tips, proceeed to the next root, etc..
494494
Preorder,
495-
///Postorder traversal, starting at the root(s) of a [`TreeInterface`].
495+
///Postorder traversal, starting at the root(s) of a tree.
496496
///For trees with multiple roots, start at the left root,
497497
///traverse to tips, proceeed to the next root, etc..
498498
Postorder,

src/trees/tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'treeseq> Tree<'treeseq> {
6666
///
6767
/// # Parameters
6868
///
69-
/// * `by_span`: if `true`, multiply the return value by [`TreeInterface::span`].
69+
/// * `by_span`: if `true`, multiply the return value by [`Tree::span`].
7070
///
7171
/// # Errors
7272
///
@@ -303,7 +303,7 @@ impl<'treeseq> Tree<'treeseq> {
303303
///
304304
/// # Parameters
305305
///
306-
/// * `order`: A value from [`NodeTraversalOrder`] specifying the
306+
/// * `order`: A value from [`crate::NodeTraversalOrder`] specifying the
307307
/// iteration order.
308308
// Return value is dyn for later addition of other traversal orders
309309
pub fn traverse_nodes(

0 commit comments

Comments
 (0)