From 626bab5a7c16e0053f5bb17fd9dd7fcbb5e54111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Meier?= Date: Fri, 2 Jul 2021 16:23:44 +0200 Subject: [PATCH] Remove unstable `Cursor::remaining` --- library/std/src/io/cursor.rs | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/library/std/src/io/cursor.rs b/library/std/src/io/cursor.rs index 04f13cdeb88e3..ae0cea985d77c 100644 --- a/library/std/src/io/cursor.rs +++ b/library/std/src/io/cursor.rs @@ -209,32 +209,6 @@ impl Cursor 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