Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description = "A library for streaming reading of files over HTTP using range re
license = "MIT"
repository = "https://github.com/prefix-dev/async_http_range_reader"
exclude = ["test-data/*"]
rust-version = "1.74"

[dependencies]
futures = "0.3.28"
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use reqwest::header::HeaderMap;
use reqwest::{Response, Url};
use sparse_range::SparseRange;
use std::{
io::{self, ErrorKind, SeekFrom},
io::{self, SeekFrom},
ops::Range,
pin::Pin,
sync::Arc,
Expand Down Expand Up @@ -476,7 +476,7 @@ async fn run_streamer(
.instrument(span)
.await
.and_then(error_for_status)
.map_err(|e| std::io::Error::new(ErrorKind::Other, e))
.map_err(std::io::Error::other)
{
Err(e) => {
state.error = Some(e.into());
Expand Down Expand Up @@ -585,7 +585,7 @@ impl AsyncRead for AsyncHttpRangeReader {

// If a previous error occurred we return that.
if let Some(e) = inner.streamer_state.error.as_ref() {
return Poll::Ready(Err(io::Error::new(io::ErrorKind::Other, e.clone())));
return Poll::Ready(Err(io::Error::other(e.clone())));
}

// Determine the range to be fetched
Expand Down Expand Up @@ -641,7 +641,7 @@ impl AsyncRead for AsyncHttpRangeReader {
Some(state) => {
inner.streamer_state = state;
if let Some(e) = inner.streamer_state.error.as_ref() {
return Poll::Ready(Err(io::Error::new(io::ErrorKind::Other, e.clone())));
return Poll::Ready(Err(io::Error::other(e.clone())));
}
}
}
Expand Down