about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-slice-array.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-14 13:27:36 +0000
committerbors <bors@rust-lang.org>2023-11-14 13:27:36 +0000
commitca8f33e19b7a64d2817e8e8f9c4ef382af46b254 (patch)
tree860028758b43fccbae460d4453b5fd6dc923d429 /tests/rustdoc-js-std/parser-slice-array.js
parentc3a6b376a43e1ce10c6f17872fd48e99ee294388 (diff)
parenta9d42e6d6d8ce6fe9789c8d06223b7b2e28ff253 (diff)
downloadrust-ca8f33e19b7a64d2817e8e8f9c4ef382af46b254.tar.gz
rust-ca8f33e19b7a64d2817e8e8f9c4ef382af46b254.zip
Auto merge of #11778 - granddaifuku:fix/reduce-indexing-manual_memcpy-when-array-length-is-equal-to-range, r=blyxyas
fix: [manual_memcpy] reduce indexing suggestions when array length is equal to loop range

fixes: #11689

This PR improves `manual_memcpy` suggestions by reducing unnecessary indexing.

For example,
```rust
let src = [0, 1, 2, 3, 4];
let mut dest = [0; 4];
for i in 0..4 {
    dest[i] = src[i];
{
```
Clippy suggests `dest[..4].copy_from_slice(&src[..4]);`.
I reduced this suggestion as `dest.copy_from_slice(&src[..4]);`. (Removed needless indexing.)

changelog: [`manual_memcpy`]: Reduce indexing suggestions when array length is equal to loop range
Diffstat (limited to 'tests/rustdoc-js-std/parser-slice-array.js')
0 files changed, 0 insertions, 0 deletions