[Rust] Clean up conversions between TVM and Rust functions (#6114)
authorMax Willsey <me@mwillsey.com>
Thu, 23 Jul 2020 08:14:17 +0000 (01:14 -0700)
committerGitHub <noreply@github.com>
Thu, 23 Jul 2020 08:14:17 +0000 (01:14 -0700)
commit06d756563d805e8a12dac84c6372071f35457e4f
treec1405ce0cdb723e1a99132ced9accff29d8db754
parent5046ff25116d66032f5d1b69d240f0a655a1ed92
[Rust] Clean up conversions between TVM and Rust functions (#6114)

* Replace ToBoxedFn with From

* Compact and improve Typed and ToFunction impls

- Clone one less time
- Don't panic if number of args is wrong, return an error
- Actually drop functions/closures on the rust side

* Retry
rust/tvm-macros/src/external.rs
rust/tvm-rt/README.md
rust/tvm-rt/src/function.rs
rust/tvm-rt/src/lib.rs
rust/tvm-rt/src/to_boxed_fn.rs [deleted file]
rust/tvm-rt/src/to_function.rs