diff options
author | Dan Gohman <dev@sunfishcode.online> | 2021-11-06 17:34:39 -0700 |
---|---|---|
committer | Dan Gohman <dev@sunfishcode.online> | 2021-12-02 13:03:32 -0800 |
commit | 3d1b98a3bf6ee8b2fa9080c5e09a216bdccc4a68 (patch) | |
tree | 79a2bd58767983fafe93d094f4e3a225c753cdb9 | |
parent | afe84a3b7c57e2461eee38869cbf887073c2d73f (diff) | |
download | rust-3d1b98a3bf6ee8b2fa9080c5e09a216bdccc4a68.tar.gz |
Use rustix's `SeekFrom`.
-rw-r--r-- | library/std/src/io/mod.rs | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 8cc91566418..c9a9f56b76f 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -1896,29 +1896,8 @@ pub trait Seek { /// Enumeration of possible methods to seek within an I/O object. /// /// It is used by the [`Seek`] trait. -#[derive(Copy, PartialEq, Eq, Clone, Debug)] #[stable(feature = "rust1", since = "1.0.0")] -pub enum SeekFrom { - /// Sets the offset to the provided number of bytes. - #[stable(feature = "rust1", since = "1.0.0")] - Start(#[stable(feature = "rust1", since = "1.0.0")] u64), - - /// Sets the offset to the size of this object plus the specified number of - /// bytes. - /// - /// It is possible to seek beyond the end of an object, but it's an error to - /// seek before byte 0. - #[stable(feature = "rust1", since = "1.0.0")] - End(#[stable(feature = "rust1", since = "1.0.0")] i64), - - /// Sets the offset to the current position plus the specified number of - /// bytes. - /// - /// It is possible to seek beyond the end of an object, but it's an error to - /// seek before byte 0. - #[stable(feature = "rust1", since = "1.0.0")] - Current(#[stable(feature = "rust1", since = "1.0.0")] i64), -} +pub use rustix::io::SeekFrom; fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>) -> Result<usize> { let mut read = 0; |