Skip to content

Added examples to std.array.split#5567

Merged
dlang-bot merged 1 commit intodlang:masterfrom
JackStouffer:split-examples
Jul 7, 2017
Merged

Added examples to std.array.split#5567
dlang-bot merged 1 commit intodlang:masterfrom
JackStouffer:split-examples

Conversation

@JackStouffer
Copy link
Contributor

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
Contributor

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
Contributor

@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
Contributor

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
Contributor 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