Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
behinger authored Aug 5, 2024
1 parent 3633f3b commit 6a4b16d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datastructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ postwalk(f, t::File; collect_children=identity) = f(t)
apply `f` to every node in the tree. To only visit File nodes, pass `dirs=false`.
walk can be either `FileTrees.postwalk` or `FileTrees.postwalk`.
walk can be either `FileTrees.postwalk` or `FileTrees.prewalk`. Which applies the function after recursively walking the tree, or before.
"""
function Base.map(f, tree::FileTree; walk=postwalk, dirs=true)
walk(tree, collect_children=identity) do n
Expand All @@ -354,7 +354,7 @@ Return a copy of `tree`, removing nodes for which `f` is `false`.
The function `f` is passed all nodes (`File`s and `FileTree`s) if `dirs=true`
and leaf nodes (`File`s) if `dirs=false`.
`walk` can be either `FileTrees.postwalk` or `FileTrees.postwalk`.
`walk` can be either `FileTrees.postwalk` or `FileTrees.prewalk`. Which applies the function after recursively walking the tree, or before.
"""
function Base.filter(f, tree::FileTree; walk=prewalk, dirs=true)
walk(tree, collect_children=cs->filter(!isnothing, cs)) do n
Expand Down

0 comments on commit 6a4b16d

Please sign in to comment.