Similar methods in Vec are annotated with #[inline] including Vec::len but Vec::is_empty is not. Looking at the relevant policy it seems to me is_empty satisfies all the requirements to be inlined. Is this deliberate or it could be beneficial to add it?
To be more precise, I am referring to this function: https://doc.rust-lang.org/nightly/src/alloc/vec/mod.rs.html#3040.
Curiously, this other implementation of is_empty for slices is inline: https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#136
Similar methods in
Vecare annotated with#[inline]includingVec::lenbutVec::is_emptyis not. Looking at the relevant policy it seems to meis_emptysatisfies all the requirements to be inlined. Is this deliberate or it could be beneficial to add it?To be more precise, I am referring to this function: https://doc.rust-lang.org/nightly/src/alloc/vec/mod.rs.html#3040.
Curiously, this other implementation of
is_emptyfor slices isinline: https://doc.rust-lang.org/nightly/src/core/slice/mod.rs.html#136