Skip to content

Commit

Permalink
Better names, style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallpierce committed Feb 22, 2021
1 parent db3d7a5 commit 152a0cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion onnxruntime-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fn generate_bindings(include_dir: &Path) {
.expect("Couldn't write bindings!");
}

fn download<P: AsRef<Path>>(source_url: &str, target_file: P) {
fn download<P>(source_url: &str, target_file: P) where P: AsRef<Path> {
let resp = ureq::get(source_url)
.timeout_connect(1_000) // 1 second
.timeout(std::time::Duration::from_secs(300))
Expand Down
9 changes: 5 additions & 4 deletions onnxruntime/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ pub(crate) fn status_to_result(
}

/// A wrapper around a function on OrtApi that maps the status code into [OrtApiError]
pub(crate) unsafe fn call_ort<F: FnMut(sys::OrtApi) -> *const sys::OrtStatus>(
mut block: F,
) -> std::result::Result<(), OrtApiError> {
status_to_result(block(g_ort()))
pub(crate) unsafe fn call_ort<F>(mut f: F) -> std::result::Result<(), OrtApiError>
where
F: FnMut(sys::OrtApi) -> *const sys::OrtStatus,
{
status_to_result(f(g_ort()))
}

0 comments on commit 152a0cd

Please sign in to comment.