Skip to content

Conversation

steveklabnik
Copy link
Contributor

This can be confusing when whitespace is the separator

Fixes #25986

This can be confusing when whitespace is the separator

Fixes rust-lang#25986
@rust-highfive
Copy link
Contributor

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+ 96c7a6b

Copy link
Contributor

Choose a reason for hiding this comment

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

"Does not give" you isn't that too confusing to bring up? What if we instead show that d.filter(|s| !s.is_empty()) produces this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought contrasting with another common way it could be implemented would be clarifying

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. I realize I'm not the target audience, I don't actually know what style works best to communicate.

I would not use this style myself -- I would not mention confusion, I would just underscore the facts as well as possible.

Just my thoughts -- it's awesome this PR addresses this in some way, by underscoring the facts of how this function works!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am usually on that side too, but this seems like a pretty common confusion.

Copy link
Member

Choose a reason for hiding this comment

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

How about assert!(d != &["a", "b", "c"])?

@bors
Copy link
Collaborator

bors commented Jun 10, 2015

⌛ Testing commit 96c7a6b with merge e954031...

bors added a commit that referenced this pull request Jun 10, 2015
This can be confusing when whitespace is the separator

Fixes #25986
@bors bors merged commit 96c7a6b into rust-lang:master Jun 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants