Commit 631faa1
committed
Auto merge of rust-lang#11146 - hydro-project:tuple-array-conversions, r=Centri3,xFrednet
[`tuple_array_conversions`]: move from `complexity` to `nursery`
The lint suggestion is arguably often less readable and more complex than the original code.
For example, which of the following is the most readable:
```rust
let _vertices = edges.flat_map(|(src, dst)| [src, dst]);
let _vertices = edges.flat_map(<_ as Into<[i32; 2]>>::into);
let _vertices = edges.flat_map(<[i32; 2]>::from);
```
The lint can be useful, but really only applies if the tuple is either long enough that naming the fields is silly (maybe at least 4 entries long), or if the author intends the fields to be homogenous, which is author intent and can't be determined by the lint. Therefore I think the lint should be marked as pedantic.
Currently, there are also a lot of false positives with the lint:
* rust-lang/rust-clippy#11082
* rust-lang/rust-clippy#11085
* rust-lang/rust-clippy#11100 (rust-lang/rust-clippy#11105)
* rust-lang/rust-clippy#11124
* rust-lang/rust-clippy#11144
Should fix those issues before enabling it for everyone.
---
changelog: Move [`tuple_array_conversions`] to `nursery` (Now allow-by-default)
<!-- FIY: Ignore this change, if the commit gets backported -->
[rust-lang#11146](rust-lang/rust-clippy#11146)1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
0 commit comments