mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-12 01:47:38 +00:00
Add "could be written as" example to MANUAL_MEMCPY
This commit is contained in:
parent
49dff2c9f3
commit
b17cb32bcb
@ -48,6 +48,12 @@ declare_clippy_lint! {
|
|||||||
/// dst[i + 64] = src[i];
|
/// dst[i + 64] = src[i];
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
/// Could be written as:
|
||||||
|
/// ```rust
|
||||||
|
/// # let src = vec![1];
|
||||||
|
/// # let mut dst = vec![0; 65];
|
||||||
|
/// dst[64..(src.len() + 64)].clone_from_slice(&src[..]);
|
||||||
|
/// ```
|
||||||
pub MANUAL_MEMCPY,
|
pub MANUAL_MEMCPY,
|
||||||
perf,
|
perf,
|
||||||
"manually copying items between slices"
|
"manually copying items between slices"
|
||||||
|
Loading…
Reference in New Issue
Block a user