jroesch commented on a change in pull request #5769:
URL: https://github.com/apache/incubator-tvm/pull/5769#discussion_r441186800
##########
File path: rust/tvm-rt/src/to_function.rs
##########
@@ -46,46 +46,52 @@ pub use tvm_sys::{ffi, ArgValue, RetValue};
/// And the implementation of it to `ToFunction`.
pub trait Typed<I, O> {
fn args(i: &[ArgValue<'static>]) -> Result<I>;
- fn ret(o: O) -> RetValue;
+ fn ret(o: O) -> Result<RetValue>;
}
-impl<F, O: Into<RetValue>> Typed<(), O> for F
+impl<F, O, E> Typed<(), O> for F
where
F: Fn() -> O,
+ Error: From<E>,
Review comment:
This allows us to convert the Result<T, E> into Result<T, Error> below.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]