Skip to content

Commit 749a589

Browse files
authored
Rollup merge of #86811 - soerenmeier:remove_remaining, r=yaahc
Remove unstable `io::Cursor::remaining` Adding `io::Cursor::remaining` in #86037 caused a conflict with the implementation of `bytes::Buf` for `io::Cursor`, leading to an error in nightly, see #86369 (comment). This fixes the error by temporarily removing the `remaining` function. r? `@yaahc`
2 parents b507cd1 + 626bab5 commit 749a589

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

library/std/src/io/cursor.rs

-26
Original file line numberDiff line numberDiff line change
@@ -209,32 +209,6 @@ impl<T> Cursor<T>
209209
where
210210
T: AsRef<[u8]>,
211211
{
212-
/// Returns the remaining length.
213-
///
214-
/// # Examples
215-
///
216-
/// ```
217-
/// #![feature(cursor_remaining)]
218-
/// use std::io::Cursor;
219-
///
220-
/// let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]);
221-
///
222-
/// assert_eq!(buff.remaining(), 5);
223-
///
224-
/// buff.set_position(2);
225-
/// assert_eq!(buff.remaining(), 3);
226-
///
227-
/// buff.set_position(4);
228-
/// assert_eq!(buff.remaining(), 1);
229-
///
230-
/// buff.set_position(6);
231-
/// assert_eq!(buff.remaining(), 0);
232-
/// ```
233-
#[unstable(feature = "cursor_remaining", issue = "86369")]
234-
pub fn remaining(&self) -> u64 {
235-
(self.inner.as_ref().len() as u64).checked_sub(self.pos).unwrap_or(0)
236-
}
237-
238212
/// Returns the remaining slice.
239213
///
240214
/// # Examples

0 commit comments

Comments
 (0)