Skip to content

Commit ed8aba5

Browse files
jferrantwileyj
authored andcommitted
Replace use of io::Error::new(io::ErrorKind::Other..) with io::Error::Other(..)
Signed-off-by: Jacinta Ferrant <jacinta.ferrant@gmail.com>
1 parent eb4154b commit ed8aba5

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

stacks-common/src/util/chunked_encoding.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,9 @@ impl HttpChunkedTransferReaderState {
186186
assert_eq!(self.parse_step, HttpChunkedTransferParseMode::Chunk);
187187

188188
if self.total_size >= self.max_size && self.chunk_size > 0 {
189-
return Err(io::Error::new(
190-
io::ErrorKind::Other,
191-
ChunkedError::OverflowError(
192-
"HTTP body exceeds maximum expected length".to_string(),
193-
),
194-
));
189+
return Err(io::Error::other(ChunkedError::OverflowError(
190+
"HTTP body exceeds maximum expected length".to_string(),
191+
)));
195192
}
196193

197194
let remaining = if self.chunk_size - self.chunk_read <= (self.max_size - self.total_size) {

stackslib/src/net/httpcore.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,18 +1979,14 @@ pub fn send_http_request(
19791979
let path = &request.preamble().path_and_query_str;
19801980
let resp_status_code = response.preamble().status_code;
19811981
let resp_body = response.body();
1982-
return Err(io::Error::new(
1983-
io::ErrorKind::Other,
1982+
return Err(io::Error::other(
19841983
format!(
19851984
"HTTP '{verb} {path}' did not succeed ({resp_status_code} != 200). Response body = {resp_body:?}"
19861985
),
19871986
));
19881987
}
19891988
_ => {
1990-
return Err(io::Error::new(
1991-
io::ErrorKind::Other,
1992-
"Did not receive an HTTP response",
1993-
));
1989+
return Err(io::Error::other("Did not receive an HTTP response"));
19941990
}
19951991
};
19961992

0 commit comments

Comments
 (0)