A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rust-lang/rust/issues/81656 below:

Tracking Issue for vec_extend_from_within · Issue #81656 · rust-lang/rust · GitHub

Feature gate: #![feature(vec_extend_from_within)]

This is a tracking issue for Vec::vec_extend_from_within, which allows copying elements from a range to the end:

#![feature(vec_extend_from_within)]

let mut vec = vec![0, 1, 2, 3, 4];

vec.extend_from_within(2..);
assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);

vec.extend_from_within(..2);
assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);

vec.extend_from_within(4..8);
assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
Public API
impl<T: Clone, A: Allocator> Vec<T, A> {
    pub fn extend_from_within<R>(&mut self, src: R)
    where
        R: RangeBounds<usize>;
}
Steps / History Unresolved Questions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4