Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a more sophisticated
DepthBehavior
type.
This change replaces the simple `usize` of the `WalkBehavior::depth` field with a much more rich `DepthBehavior` type. `DepthBehavior` supports both minimum and maximum depth bounds and is well-typed to provide better APIs and conversions. Perhaps more importantly, this change removes much of the awareness of invariant prefixes and adjusted roots in `Glob`s from the base walk implementation over paths. Root and relative paths are now more consistent, referring to the walked `Path` or, similarly, the path given to `Glob::walk` functions. The only exception are `Glob`s that have a root, for which the root is formed from the invariant prefix (because a rooted prefix escapes the path given to `Glob::walk` functions). Depth too is now more consistently applied from this root. Prefixes in `Glob`s are no longer exposed in walk APIs (`GlobWalker` has been removed from public APIs). To allow for more control over depth behaviors, `Glob` can expose depth variance, which can then be used to construct a `DepthBehavior`. This is not implemented by this change.
- Loading branch information
1 parent
93c5926
commit 905778b
Showing
5 changed files
with
553 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.