Skip to content

Added examples to std.array.split #5567

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

Merged
merged 1 commit into from
Jul 7, 2017

Conversation

JackStouffer
Copy link
Member

No description provided.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @JackStouffer!

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.

@wilzbach
Copy link
Member

wilzbach commented Jul 7, 2017

Btw @JackStouffer I am not so sure whether you noticed, but since #5495 and #5501, there's a selective module blacklist for all not fully enabled DScanner checks.

For example, one can remove std.array from the has_public_example blacklist and would get:

std/array.d(204:31)[warn]: Public declaration 'array' has no documented example.
std/array.d(521:6)[warn]: Public declaration 'uninitializedArray' has no documented example.
std/array.d(576:6)[warn]: Public declaration 'minimallyInitializedArray' has no documented example.
std/array.d(1489:6)[warn]: Public declaration 'split' has no documented example.
std/array.d(3118:8)[warn]: Public declaration 'RefAppender' has no documented example.
std/array.d(3193:12)[warn]: Public declaration 'appender' has no documented example.
std/array.d(3569:19)[warn]: Public declaration 'appender' has no documented example.

(without your PR)

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

More runnable examples 😃

image

import std.algorithm.comparison : equal;

string str = "Hello World!";
assert(str.splitter!(isWhite).equal(["Hello", "World!"]));
Copy link
Member

Choose a reason for hiding this comment

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

FYI: you wouldn't need the braces around isWhite here - see it.
(I don't mind if they are added for extra clarity)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, they're just there to make things clearer. I always add them in a UFCS chain.

@dlang-bot dlang-bot merged commit ac2dbe4 into dlang:master Jul 7, 2017
@JackStouffer JackStouffer deleted the split-examples branch July 7, 2017 15:23
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