diff options
| author | Sören Meier <soeren@s-me.ch> | 2021-07-02 16:23:44 +0200 |
|---|---|---|
| committer | Sören Meier <soeren@s-me.ch> | 2021-07-02 16:23:44 +0200 |
| commit | 626bab5a7c16e0053f5bb17fd9dd7fcbb5e54111 (patch) | |
| tree | e0f5286fa6c79e896e1727c45732f693e0ad346d | |
| parent | f9fa13f705bb8b1c57c6b6fe95055ec4995a40f0 (diff) | |
| download | rust-626bab5a7c16e0053f5bb17fd9dd7fcbb5e54111.tar.gz rust-626bab5a7c16e0053f5bb17fd9dd7fcbb5e54111.zip | |
Remove unstable `Cursor::remaining`
| -rw-r--r-- | library/std/src/io/cursor.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/library/std/src/io/cursor.rs b/library/std/src/io/cursor.rs index 04f13cdeb88..ae0cea985d7 100644 --- a/library/std/src/io/cursor.rs +++ b/library/std/src/io/cursor.rs @@ -209,32 +209,6 @@ impl<T> Cursor<T> where T: AsRef<[u8]>, { - /// Returns the remaining length. - /// - /// # Examples - /// - /// ``` - /// #![feature(cursor_remaining)] - /// use std::io::Cursor; - /// - /// let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]); - /// - /// assert_eq!(buff.remaining(), 5); - /// - /// buff.set_position(2); - /// assert_eq!(buff.remaining(), 3); - /// - /// buff.set_position(4); - /// assert_eq!(buff.remaining(), 1); - /// - /// buff.set_position(6); - /// assert_eq!(buff.remaining(), 0); - /// ``` - #[unstable(feature = "cursor_remaining", issue = "86369")] - pub fn remaining(&self) -> u64 { - (self.inner.as_ref().len() as u64).checked_sub(self.pos).unwrap_or(0) - } - /// Returns the remaining slice. /// /// # Examples |
