Skip to content

Commit

Permalink
Remove stream_len functions entirely.
Browse files Browse the repository at this point in the history
Most of the `seek_convenience` feature was stablized, but `stream_len`
was not [0]. To minimize version incompatibilities here, just remove
our `stream_len` functions for now and rely on the defaults.

[0]: rust-lang/rust#70904
  • Loading branch information
sunfishcode committed Feb 4, 2021
1 parent d8efe4b commit 2f7c2c4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 32 deletions.
4 changes: 0 additions & 4 deletions cap-async-std/src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ impl Seek for File {
Seek::poll_seek(Pin::new(&mut self.std), cx, pos)
}

// async_std doesn't have `stream_len`.

// async_std doesn't have `seek_convenience`.
}

Expand All @@ -309,8 +307,6 @@ impl Seek for &File {
Seek::poll_seek(Pin::new(&mut &self.std), cx, pos)
}

// async_std doesn't have `stream_len`.

// async_std doesn't have `seek_convenience`.
}

Expand Down
4 changes: 0 additions & 4 deletions cap-async-std/src/fs_utf8/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ impl Seek for File {
Seek::poll_seek(Pin::new(&mut self.cap_std), cx, pos)
}

// async_std doesn't have `stream_len`.

// async_std doesn't have `stream_position`.
}

Expand All @@ -279,8 +277,6 @@ impl Seek for &File {
Seek::poll_seek(Pin::new(&mut &self.cap_std), cx, pos)
}

// async_std doesn't have `stream_len`.

// async_std doesn't have `stream_position`.
}

Expand Down
12 changes: 0 additions & 12 deletions cap-std/src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,6 @@ impl Seek for File {
self.std.seek(pos)
}

#[cfg(seek_convenience)]
#[inline]
fn stream_len(&mut self) -> io::Result<u64> {
self.std.stream_len()
}

#[cfg(seek_convenience)]
#[inline]
fn stream_position(&mut self) -> io::Result<u64> {
Expand All @@ -342,12 +336,6 @@ impl Seek for &File {
(&mut &self.std).seek(pos)
}

#[cfg(seek_convenience)]
#[inline]
fn stream_len(&mut self) -> io::Result<u64> {
(&mut &self.std).stream_len()
}

#[cfg(seek_convenience)]
#[inline]
fn stream_position(&mut self) -> io::Result<u64> {
Expand Down
12 changes: 0 additions & 12 deletions cap-std/src/fs_utf8/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,6 @@ impl Seek for File {
self.cap_std.seek(pos)
}

#[cfg(seek_convenience)]
#[inline]
fn stream_len(&mut self) -> io::Result<u64> {
self.cap_std.stream_len()
}

#[cfg(seek_convenience)]
#[inline]
fn stream_position(&mut self) -> io::Result<u64> {
Expand All @@ -321,12 +315,6 @@ impl Seek for &File {
(&mut &self.cap_std).seek(pos)
}

#[cfg(seek_convenience)]
#[inline]
fn stream_len(&mut self) -> io::Result<u64> {
(&mut &self.cap_std).stream_len()
}

#[cfg(seek_convenience)]
#[inline]
fn stream_position(&mut self) -> io::Result<u64> {
Expand Down

0 comments on commit 2f7c2c4

Please sign in to comment.