mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
Rollup merge of #61926 - scottmcm:vec-vecdeque, r=Mark-Simulacrum
Fix hyperlinks in From impls between Vec and VecDeque I'd been trying to link them, but apparently actually just added brackets: <https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#impl-From%3CVec%3CT%3E%3E> ~~This reverts commit 5168f5d220d0b30d322f254f51142931a9054056.~~ ~~(I'd previously tried to make relative links, but those failed linkcheck because the types are exported at different levels. So just skip the links -- they're already linked in the function signature anyway.)~~ This makes the links now work.
This commit is contained in:
@@ -2721,6 +2721,9 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
impl<T> From<Vec<T>> for VecDeque<T> {
|
||||
/// Turn a [`Vec<T>`] into a [`VecDeque<T>`].
|
||||
///
|
||||
/// [`Vec<T>`]: crate::vec::Vec
|
||||
/// [`VecDeque<T>`]: crate::collections::VecDeque
|
||||
///
|
||||
/// This avoids reallocating where possible, but the conditions for that are
|
||||
/// strict, and subject to change, and so shouldn't be relied upon unless the
|
||||
/// `Vec<T>` came from `From<VecDeque<T>>` and hasn't been reallocated.
|
||||
@@ -2752,6 +2755,9 @@ fn from(mut other: Vec<T>) -> Self {
|
||||
impl<T> From<VecDeque<T>> for Vec<T> {
|
||||
/// Turn a [`VecDeque<T>`] into a [`Vec<T>`].
|
||||
///
|
||||
/// [`Vec<T>`]: crate::vec::Vec
|
||||
/// [`VecDeque<T>`]: crate::collections::VecDeque
|
||||
///
|
||||
/// This never needs to re-allocate, but does need to do O(n) data movement if
|
||||
/// the circular buffer doesn't happen to be at the beginning of the allocation.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user