You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0277]: the trait bound `Result<(), String>: IntoValue` is not satisfied
--> src/lib.rs:46:1
|
46 | #[ocaml::func]
| ^^^^^^^^^^^^^^ the trait `IntoValue` is not implemented for `Result<(), String>`
|
= help: the following other types implement trait `IntoValue`:
Result<T, E>
Result<T, ocaml::Error>
= note: this error originates in the attribute macro `ocaml::func` (in Nightly builds, run with -Z macro-backtrace for more info)
I would have thought, following the doc, that any Result<T, E> would be converted to (t, e) result in OCaml as long as both T and E implemented the needed types, but using String as error doesn't seem to work.
in the Rust doc I see that IntoValue is only implemented if E = ocaml::Error:
I also can't find tests on that, I'm guessing the book is wrong?
EDIT: I see an implementation of ToValue which is weird as I thought ToValue was not a thing anymore... in any case I can't implement IntoValue on Result myself due to the orphan rule
The text was updated successfully, but these errors were encountered:
I would have thought, following the doc, that any
Result<T, E>
would be converted to(t, e) result
in OCaml as long as bothT
andE
implemented the needed types, but usingString
as error doesn't seem to work.in the Rust doc I see that
IntoValue
is only implemented ifE = ocaml::Error
:I also can't find tests on that, I'm guessing the book is wrong?
EDIT: I see an implementation of ToValue which is weird as I thought
ToValue
was not a thing anymore... in any case I can't implementIntoValue
onResult
myself due to the orphan ruleThe text was updated successfully, but these errors were encountered: