Skip to content

RFC Add is_not_empty methods to vectors (or is_not_* generally) #6243

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

Closed
brson opened this issue May 5, 2013 · 3 comments
Closed

RFC Add is_not_empty methods to vectors (or is_not_* generally) #6243

brson opened this issue May 5, 2013 · 3 comments

Comments

@brson
Copy link
Contributor

brson commented May 5, 2013

We used to have this method but it was removed in favor of !. I still much prefer to write is_not_foo because it reads (and writes) so much better than the prefix bang (no backtracking to figure out what was negated), and checking for non-empty vectors is quite common. Similarly I use is_not_null very frequently.

Is this a pattern we collectively approve of or not?

@thomaslee
Copy link
Contributor

I'm -1 on this because somebody, somewhere, someday will make me sad with double negatives. (In all seriousness :))

@bblum
Copy link
Contributor

bblum commented Jul 13, 2013

I am largely indifferent. Leaning slightly against, because it adds neither expressivity nor convenience (it's even fewer characters for the user to type !is_empty). The Haskell libraries have a zillion convenience functions that are basically minor permutations of each other, but they all help you save characters.

@catamorphism
Copy link
Contributor

Sounds like the response to this RFC was neutral-to-negative. Closing.

flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 20, 2022
…=Manishearth

Update Applicability of `redundant_allocation` lint from `MachineApplicable` to `MaybeIncorrect`

This changes `redundant_allocation` lint from MachineApplicable to MaybeIncorrect

```
changelog: [`redundant_allocation]: Change Applicability from MachineApplicable to MaybeIncorrect

```

fixes rust-lang#6243

---
changelog: [`redundant_allocation`]: Change Applicability from MachineApplicable to MaybeIncorrect
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

No branches or pull requests

4 participants