diff options
| author | Konrad Borowski <konrad@borowski.pw> | 2020-12-28 09:13:46 +0100 |
|---|---|---|
| committer | Konrad Borowski <konrad@borowski.pw> | 2020-12-28 09:13:46 +0100 |
| commit | 9e779986aa2aaa6d28b48020f9da8f37b95959ee (patch) | |
| tree | deac9895ba79eb0eb06912be3e23c5d6ae7621cd /library/alloc/src | |
| parent | 6c523a7a0ef121fe97ad6a367a3f3b92f80dc3f0 (diff) | |
| download | rust-9e779986aa2aaa6d28b48020f9da8f37b95959ee.tar.gz rust-9e779986aa2aaa6d28b48020f9da8f37b95959ee.zip | |
Add "length" as doc alias to len methods
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/collections/binary_heap.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/collections/btree/map.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/collections/btree/set.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/collections/linked_list.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/collections/vec_deque/mod.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/string.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/vec.rs | 1 |
7 files changed, 7 insertions, 0 deletions
diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs index 97ebc12175f..76051d9e1df 100644 --- a/library/alloc/src/collections/binary_heap.rs +++ b/library/alloc/src/collections/binary_heap.rs @@ -915,6 +915,7 @@ impl<T> BinaryHeap<T> { /// /// assert_eq!(heap.len(), 2); /// ``` + #[doc(alias = "length")] #[stable(feature = "rust1", since = "1.0.0")] pub fn len(&self) -> usize { self.data.len() diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 735213363f6..944e0e65cf7 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -2132,6 +2132,7 @@ impl<K, V> BTreeMap<K, V> { /// a.insert(1, "a"); /// assert_eq!(a.len(), 1); /// ``` + #[doc(alias = "length")] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_btree_new", issue = "71835")] pub const fn len(&self) -> usize { diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index f63c3dd5804..c72e305a1f9 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -975,6 +975,7 @@ impl<T> BTreeSet<T> { /// v.insert(1); /// assert_eq!(v.len(), 1); /// ``` + #[doc(alias = "length")] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_btree_new", issue = "71835")] pub const fn len(&self) -> usize { diff --git a/library/alloc/src/collections/linked_list.rs b/library/alloc/src/collections/linked_list.rs index 4707f129401..397e774f1a0 100644 --- a/library/alloc/src/collections/linked_list.rs +++ b/library/alloc/src/collections/linked_list.rs @@ -593,6 +593,7 @@ impl<T> LinkedList<T> { /// dl.push_back(3); /// assert_eq!(dl.len(), 3); /// ``` + #[doc(alias = "length")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn len(&self) -> usize { diff --git a/library/alloc/src/collections/vec_deque/mod.rs b/library/alloc/src/collections/vec_deque/mod.rs index 7cf4041f292..42a1a08c6fc 100644 --- a/library/alloc/src/collections/vec_deque/mod.rs +++ b/library/alloc/src/collections/vec_deque/mod.rs @@ -1038,6 +1038,7 @@ impl<T> VecDeque<T> { /// v.push_back(1); /// assert_eq!(v.len(), 1); /// ``` + #[doc(alias = "length")] #[stable(feature = "rust1", since = "1.0.0")] pub fn len(&self) -> usize { count(self.tail, self.head, self.cap()) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 27b32b69502..91988928593 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1388,6 +1388,7 @@ impl String { /// assert_eq!(fancy_f.len(), 4); /// assert_eq!(fancy_f.chars().count(), 3); /// ``` + #[doc(alias = "length")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn len(&self) -> usize { diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 2b08f1f3629..c9fa41138cd 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -1559,6 +1559,7 @@ impl<T, A: Allocator> Vec<T, A> { /// let a = vec![1, 2, 3]; /// assert_eq!(a.len(), 3); /// ``` + #[doc(alias = "length")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn len(&self) -> usize { |
