phobos icon indicating copy to clipboard operation
phobos copied to clipboard

improve precondition of std.path.globMatch

Open wolframw opened this issue 3 years ago • 4 comments

This improves the somewhat hacky implementation of #8547 ~~and, more generally, makes std.algorithm.searching.balancedParens nothrow when both the range's element type and E are either char, wchar, or dchar~~.

wolframw avatar Aug 30 '22 22:08 wolframw

Thanks for your pull request and interest in making D better, @wolframw! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#8550"

dlang-bot avatar Aug 30 '22 22:08 dlang-bot

Not sure why the logger unittest fails on the auto-tester. My guess is it's the same problem as this: https://issues.dlang.org/show_bug.cgi?id=23286

wolframw avatar Aug 30 '22 22:08 wolframw

This is diverging from the auto-decoding practice done elsewhere. Don't get me wrong, I like the change, but it makes this algorithm inconsistent with the other ones.

I see... I guess one alternative would be to wrap rn.front into a try-catch (UTFException e) block and manually use the replacement char as a fallback in the catch block (or just skip in that case?).

Did you have anything specific in mind when you wrote https://github.com/dlang/phobos/pull/8547#issuecomment-1229814392?

wolframw avatar Aug 31 '22 10:08 wolframw

Did you have anything specific in mind when you wrote https://github.com/dlang/phobos/pull/8547#issuecomment-1229814392?

I was thinking of doing what you did (.byUTF on the string) at the call-site, not to change balancedParens.

Geod24 avatar Sep 01 '22 07:09 Geod24