Skip to content

Commit 9253687

Browse files
committed
Clippy: Box the larse ureq::Error in OrtDownloadError
1 parent c055ba2 commit 9253687

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

onnxruntime/src/download.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ impl AvailableOnnxModel {
8181
let resp = ureq::get(url)
8282
.timeout(Duration::from_secs(180)) // 3 minutes
8383
.call()
84+
.map_err(Box::new)
8485
.map_err(OrtDownloadError::UreqError)?;
8586

8687
assert!(resp.has("Content-Length"));

onnxruntime/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub enum OrtDownloadError {
143143
#[cfg(feature = "model-fetching")]
144144
/// Download error by ureq
145145
#[error("Error downloading data to file: {0}")]
146-
UreqError(#[from] ureq::Error),
146+
UreqError(#[from] Box<ureq::Error>),
147147
/// Error getting content-length from an HTTP GET request
148148
#[error("Error getting content-length")]
149149
ContentLengthError,

onnxruntime/tests/integration_tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ fn get_imagenet_labels() -> Result<Vec<String>, OrtDownloadError> {
304304
println!("Downloading {:?} to {:?}...", url, labels_path);
305305
let resp = ureq::get(url)
306306
.timeout(Duration::from_secs(180)) // 3 minutes
307-
.call()?;
307+
.call()
308+
.map_err(Box::new)
309+
.map_err(OrtDownloadError::UreqError)?;
308310

309311
assert!(resp.has("Content-Length"));
310312
let len = resp

0 commit comments

Comments
 (0)