diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2016-12-11 14:11:08 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2016-12-16 10:47:38 +0300 |
| commit | 71de148649bd9d2548b55e5d52bd0c8b38ffec44 (patch) | |
| tree | f5698ff7d1096414da0e86f90285e73551da76c5 | |
| parent | 368e092c26d40da2d4442bf7cf1b6e4df13a6f87 (diff) | |
Advertise Vec in LinkedList docs
| -rw-r--r-- | src/libcollections/linked_list.rs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index 67f3708a62b..66a61355d74 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -10,8 +10,15 @@ //! A doubly-linked list with owned nodes. //! -//! The `LinkedList` allows pushing and popping elements at either end and is thus -//! efficiently usable as a double-ended queue. +//! The `LinkedList` allows pushing and popping elements at either end +//! in constant time. +//! +//! Almost always it is better to use `Vec` or [`VecDeque`] instead of +//! [`LinkedList`]. In general, array-based containers are faster, +//! more memory efficient and make better use of CPU cache. +//! +//! [`LinkedList`]: ../linked_list/struct.LinkedList.html +//! [`VecDeque`]: ../vec_deque/struct.VecDeque.html #![stable(feature = "rust1", since = "1.0.0")] @@ -27,7 +34,14 @@ use core::ptr::{self, Shared}; use super::SpecExtend; -/// A doubly-linked list. +/// A doubly-linked list with owned nodes. +/// +/// The `LinkedList` allows pushing and popping elements at either end +/// in constant time. +/// +/// Almost always it is better to use `Vec` or `VecDeque` instead of +/// `LinkedList`. In general, array-based containers are faster, +/// more memory efficient and make better use of CPU cache. #[stable(feature = "rust1", since = "1.0.0")] pub struct LinkedList<T> { head: Option<Shared<Node<T>>>, |
