Skip to content

Comments

Use splitter instead of split in getopt#8115

Merged
dlang-bot merged 1 commit intodlang:masterfrom
dkorpel:getopt-use-splitter
May 30, 2021
Merged

Use splitter instead of split in getopt#8115
dlang-bot merged 1 commit intodlang:masterfrom
dkorpel:getopt-use-splitter

Conversation

@dkorpel
Copy link
Contributor

@dkorpel dkorpel commented May 29, 2021

Split off from #8113
split eagerly returns a GC-allocated array of slices. Since scope only applies to the top level, this returned array escapes the input string as far as dip1000 is concerned.

@dkorpel dkorpel requested a review from andralex as a code owner May 29, 2021 11:49
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @dkorpel! 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#8115"

std/getopt.d Outdated
configuration cfg) @safe
{
import std.array : split;
import std.algorithm : splitter;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grep -nr 'import std.algorithm : ' $(find etc std -name '*.d') ; test $? -eq 1
--
  | std/getopt.d:1109:    import std.algorithm : splitter;

I think you need to import std.algorithm.mutation : splitter; or whatever the submodule is.

@dkorpel dkorpel force-pushed the getopt-use-splitter branch from b5dc690 to a8d4155 Compare May 29, 2021 23:20
@dlang-bot dlang-bot merged commit 5f7816a into dlang:master May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants