Suggest size_of_val(a)
for a.len() * size_of::<T>()
#10518
Labels
size_of_val(a)
for a.len() * size_of::<T>()
#10518
Uh oh!
There was an error while loading. Please reload this page.
What it does
When
a
is&[T]
, detecta.len() * size_of::<T>()
and suggestsize_of_val(a)
instead.Lint Name
manual_slice_size_calculation
Category
complexity, perf
Advantage
Drawbacks
No response
Example
https://github.com/rust-lang/rust/blob/13afbdaa0655dda23d7129e59ac48f1ec88b2084/library/core/src/hash/mod.rs#L837
Could be written as:
The text was updated successfully, but these errors were encountered: