@@ -1110,32 +1110,17 @@ impl<T> IterMut<'_, T> {
1110
1110
/// Inserts the given element just after the element most recently returned by `.next()`.
1111
1111
/// The inserted element does not appear in the iteration.
1112
1112
///
1113
- /// # Examples
1114
- ///
1115
- /// ```
1116
- /// #![feature(linked_list_extras)]
1117
- ///
1118
- /// use std::collections::LinkedList;
1119
- ///
1120
- /// let mut list: LinkedList<_> = vec![1, 3, 4].into_iter().collect();
1121
- ///
1122
- /// {
1123
- /// let mut it = list.iter_mut();
1124
- /// assert_eq!(it.next().unwrap(), &1);
1125
- /// // insert `2` after `1`
1126
- /// it.insert_next(2);
1127
- /// }
1128
- /// {
1129
- /// let vec: Vec<_> = list.into_iter().collect();
1130
- /// assert_eq!(vec, [1, 2, 3, 4]);
1131
- /// }
1132
- /// ```
1113
+ /// This method will be removed soon.
1133
1114
#[ inline]
1134
1115
#[ unstable(
1135
1116
feature = "linked_list_extras" ,
1136
1117
reason = "this is probably better handled by a cursor type -- we'll see" ,
1137
1118
issue = "27794"
1138
1119
) ]
1120
+ #[ rustc_deprecated(
1121
+ reason = "Deprecated in favor of CursorMut methods. This method will be removed soon." ,
1122
+ since = "1.47.0"
1123
+ ) ]
1139
1124
pub fn insert_next ( & mut self , element : T ) {
1140
1125
match self . head {
1141
1126
// `push_back` is okay with aliasing `element` references
@@ -1163,27 +1148,17 @@ impl<T> IterMut<'_, T> {
1163
1148
1164
1149
/// Provides a reference to the next element, without changing the iterator.
1165
1150
///
1166
- /// # Examples
1167
- ///
1168
- /// ```
1169
- /// #![feature(linked_list_extras)]
1170
- ///
1171
- /// use std::collections::LinkedList;
1172
- ///
1173
- /// let mut list: LinkedList<_> = vec![1, 2, 3].into_iter().collect();
1174
- ///
1175
- /// let mut it = list.iter_mut();
1176
- /// assert_eq!(it.next().unwrap(), &1);
1177
- /// assert_eq!(it.peek_next().unwrap(), &2);
1178
- /// // We just peeked at 2, so it was not consumed from the iterator.
1179
- /// assert_eq!(it.next().unwrap(), &2);
1180
- /// ```
1151
+ /// This method will be removed soon.
1181
1152
#[ inline]
1182
1153
#[ unstable(
1183
1154
feature = "linked_list_extras" ,
1184
1155
reason = "this is probably better handled by a cursor type -- we'll see" ,
1185
1156
issue = "27794"
1186
1157
) ]
1158
+ #[ rustc_deprecated(
1159
+ reason = "Deprecated in favor of CursorMut methods. This method will be removed soon." ,
1160
+ since = "1.47.0"
1161
+ ) ]
1187
1162
pub fn peek_next ( & mut self ) -> Option < & mut T > {
1188
1163
if self . len == 0 {
1189
1164
None
0 commit comments