Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Apr 15, 2019

I think sometimes the closure is easier to read. Compare

x.map(|s| s.to_string())

vs

x.map(std::string::ToString::to_string)

I think it is also easier to modify when it is a closure. However, I don't feel strongly about it, so if anyone wants the Clippy form, I'm fine with switching things over to that.

@rust-highfive
Copy link

r? @nrc

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 15, 2019
@nrc
Copy link
Member

nrc commented Apr 15, 2019

I'm fine either way. The Clippy form would be marginally faster, but I agree it is often not as nice to read

@alexcrichton
Copy link
Member

@bors: r=nrc

FWIW I find it sort of sad how many #![allow] annotations we need in Cargo, I feel like that clearly indicates clippy's default set of lints isn't right...

@bors
Copy link
Contributor

bors commented Apr 15, 2019

📌 Commit f818762 has been approved by nrc

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 15, 2019
@bors
Copy link
Contributor

bors commented Apr 15, 2019

⌛ Testing commit f818762 with merge 73ed6a5...

bors added a commit that referenced this pull request Apr 15, 2019
Ignore Clippy redundant_closure

I think sometimes the closure is easier to read. Compare

```rust
x.map(|s| s.to_string())
```

vs

```rust
x.map(std::string::ToString::to_string)
```

I think it is also easier to modify when it is a closure. However, I don't feel strongly about it, so if anyone wants the Clippy form, I'm fine with switching things over to that.
@bors
Copy link
Contributor

bors commented Apr 15, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: nrc
Pushing 73ed6a5 to master...

@bors bors merged commit f818762 into rust-lang:master Apr 15, 2019
@Xanewok
Copy link
Contributor

Xanewok commented Apr 16, 2019

FWIW most of the std traits are included in the prelude so this would be

x.map(ToString::to_string)

while it's more concise, there's still an unfortunate stutter.

bors added a commit to rust-lang/rust that referenced this pull request Apr 16, 2019
Update cargo

16 commits in 6f3e9c367abb497c64f360c3839dab5e74928d5c..b6581d383ed596b133e330011658c6f83cf85c2f
2019-04-04 14:11:33 +0000 to 2019-04-16 16:02:11 +0000
- Fix new_warning_with_corrupt_ws missing "USER". (rust-lang/cargo#6857)
- Ignore Clippy redundant_closure (rust-lang/cargo#6855)
- Pass OsStr/OsString args through to the process spawned by cargo run. (rust-lang/cargo#6849)
- Bump to 0.37.0 (rust-lang/cargo#6852)
- Fix test include_overrides_gitignore. (rust-lang/cargo#6850)
- Clarify optional registry key behaviour (rust-lang/cargo#6851)
- Ensure Summary::checksum works for registry crates (rust-lang/cargo#6842)
- Better error if PathSource::walk can't access something. (rust-lang/cargo#6841)
- Improve warning in `cargo new` with parse error. (rust-lang/cargo#6839)
- Improve error message for `publish` key restriction. (rust-lang/cargo#6838)
- Remove `Freshness` from `DependencyQueue` (rust-lang/cargo#6832)
- testsuite: cleanup for `alternative-registries` (rust-lang/cargo#6837)
- Improve error message to rerun a test in a workspace. (rust-lang/cargo#6824)
- Fix mutable_borrow_reservation_conflict warning. (rust-lang/cargo#6829)
- Add install-upgrade. (rust-lang/cargo#6798)
- Clarify docs of install without <crate> (rust-lang/cargo#6823)
@ehuss ehuss added this to the 1.36.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants