Skip to content

Commit

Permalink
Merge pull request #71 from DrChainsaw/filterdocfix
Browse files Browse the repository at this point in the history
Fix filter docstring
  • Loading branch information
DrChainsaw authored Aug 15, 2022
2 parents 92b493d + 8194c40 commit 8c01397
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/datastructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,14 @@ function Base.map(f, tree::FileTree; walk=postwalk, dirs=true)
end

"""
map(f, tree::FileTree; walk=FileTrees.postwalk, dirs=true)
apply `f` to every node in the tree. To only visit File nodes, pass `dirs=false`.
filter(f, tree::FileTree; walk=FileTrees.postwalk, dirs=true)
walk can be either `FileTrees.postwalk` or `FileTrees.postwalk`.
Return a copy of `tree`, removing nodes for which `f` is `false`.
filter(f, tree::FileTree; walk=FileTrees.postwalk, dirs=true)
The function `f` is passed all nodes (`File`s and `FileTree`s) if `dirs=true`
and leaf nodes (`File`s) if `dirs=false`.
remove every node `x` from `tree` where `f(x)` is `true`. `f(x)` must return a boolean value.
`walk` can be either `FileTrees.postwalk` or `FileTrees.postwalk`.
"""
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 8c01397

Please sign in to comment.