Skip to content

Commit

Permalink
Rust 1.51 upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
jpochyla committed Apr 2, 2021
1 parent 0bb5258 commit 0141eb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[workspace]

members = [
"psst-protocol",
"psst-core",
Expand All @@ -8,3 +7,6 @@ members = [
"minivorbis-sys",
"minivorbis",
]

[profile.dev]
split-debuginfo = "unpacked"
4 changes: 2 additions & 2 deletions psst-core/src/stream_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl StreamWriter {

impl Write for StreamWriter {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
let position = self.writer.seek(SeekFrom::Current(0))?;
let position = self.writer.stream_position()?;
let written = self.writer.write(buf)?;
self.data_map.mark_as_downloaded(position, written as u64);
Ok(written)
Expand All @@ -163,7 +163,7 @@ const PREFETCH_READ_LENGTH: u64 = 1024 * 256;

impl Read for StreamReader {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
let position = self.reader.seek(SeekFrom::Current(0))?;
let position = self.reader.stream_position()?;
let remaining_len = self.data_map.remaining(position);
if remaining_len == 0 {
return Ok(0); // We're at the end of the file.
Expand Down

0 comments on commit 0141eb2

Please sign in to comment.