Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: filter_entry misbehaves when contents_first is enabled #198

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Apr 16, 2024

  1. bug: filter_entry misbehaved when contents_first is set

    The behavior of `IntoIter::filter_entry` contradicted its documentation
    when the `contents_first` was enabled and the predicate returned `false`
    for directories.
    
    > Note that if the iterator has contents_first enabled, then this method
    > is no different than calling the standard Iterator::filter method
    
    According to the documentation, it must list all the entries in the
    skipped directories anyway, but listed only few of them.
    
    This commit fixes the issue by making `FilterEntry::next` call
    a newly introduced `IntoIter::skip_current_dir_unless_contents_first`
    method instead of the `IntoIter::skip_current_dir` method when the
    predicate returns `false` for a directory. `FilterEntry::next` used to
    skip a wrong directory when the predicate returned `false`.
    kikuomax committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    d4ac8c5 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

  1. test: test filter_entry and contents_first

    A new test case `filter_entry_contents_first` makes sure that
    `filter_entry` enumerates all the contents except for entries filtered
    out, if `contents_first` is enabled.
    kikuomax committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    5977b2e View commit details
    Browse the repository at this point in the history