File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 1010
1111//! A doubly-linked list with owned nodes.
1212//!
13- //! The `LinkedList` allows pushing and popping elements at either end and is thus
14- //! efficiently usable as a double-ended queue.
13+ //! The `LinkedList` allows pushing and popping elements at either end
14+ //! in constant time.
15+ //!
16+ //! Almost always it is better to use `Vec` or [`VecDeque`] instead of
17+ //! [`LinkedList`]. In general, array-based containers are faster,
18+ //! more memory efficient and make better use of CPU cache.
19+ //!
20+ //! [`LinkedList`]: ../linked_list/struct.LinkedList.html
21+ //! [`VecDeque`]: ../vec_deque/struct.VecDeque.html
1522
1623#![ stable( feature = "rust1" , since = "1.0.0" ) ]
1724
@@ -27,7 +34,14 @@ use core::ptr::{self, Shared};
2734
2835use super :: SpecExtend ;
2936
30- /// A doubly-linked list.
37+ /// A doubly-linked list with owned nodes.
38+ ///
39+ /// The `LinkedList` allows pushing and popping elements at either end
40+ /// in constant time.
41+ ///
42+ /// Almost always it is better to use `Vec` or `VecDeque` instead of
43+ /// `LinkedList`. In general, array-based containers are faster,
44+ /// more memory efficient and make better use of CPU cache.
3145#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3246pub struct LinkedList < T > {
3347 head : Option < Shared < Node < T > > > ,
You can’t perform that action at this time.
0 commit comments