Skip to content

Commit

Permalink
Slightly improved docs for traversal docs. (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 19, 2022
1 parent 0670468 commit 963055b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions git-repository/src/object/tree/traverse.rs
Expand Up @@ -15,11 +15,11 @@ impl<'repo> Tree<'repo> {
/// An intermediate object to start traversing the parent tree from.
pub struct Platform<'a, 'repo> {
root: &'a Tree<'repo>,
#[allow(missing_docs)] // TODO
/// Provides easy access to presets for common breadth-first traversal.
pub breadthfirst: BreadthFirstPresets<'a, 'repo>,
}

#[allow(missing_docs)] // TODO
/// Presets for common choices in breadth-first traversal.
#[derive(Copy, Clone)]
pub struct BreadthFirstPresets<'a, 'repo> {
root: &'a Tree<'repo>,
Expand All @@ -39,8 +39,11 @@ impl<'a, 'repo> BreadthFirstPresets<'a, 'repo> {
}

impl<'a, 'repo> Platform<'a, 'repo> {
/// Start a breadth-first traversal with a delegate, note that it's not sorted.
/// TODO: more docs or links to git-traverse
/// Start a breadth-first traversal using `delegate`, for which a [`Recorder`][git_traverse::tree::Recorder] can be used to get started.
///
/// # Note
///
/// Results are not sorted.
pub fn breadthfirst<V>(&self, delegate: &mut V) -> Result<(), git_traverse::tree::breadthfirst::Error>
where
V: git_traverse::tree::Visit,
Expand Down

0 comments on commit 963055b

Please sign in to comment.