Skip to content

Vec::extend_from_slice documentation outdated? #49228

@sinkuu

Description

@sinkuu

The documentation of Vec::extend_from_slice says:

Note that this function is same as extend except that it is specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available).

But its implementation is just delegated to SpecExtend, so the doc may be misleading to use a less-ergonomic way that is going to be deprecated. Or, is there sill performance gains by using extend_from_slice in some circumstances?

rust/src/liballoc/vec.rs

Lines 1343 to 1345 in c19264f

pub fn extend_from_slice(&mut self, other: &[T]) {
self.spec_extend(other.iter())
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions