File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 10
10
11
11
//! A doubly-linked list with owned nodes.
12
12
//!
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
15
22
16
23
#![ stable( feature = "rust1" , since = "1.0.0" ) ]
17
24
@@ -27,7 +34,14 @@ use core::ptr::{self, Shared};
27
34
28
35
use super :: SpecExtend ;
29
36
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.
31
45
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
32
46
pub struct LinkedList < T > {
33
47
head : Option < Shared < Node < T > > > ,
You can’t perform that action at this time.
0 commit comments