docs.rs failed to build derive_from-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
derive_from
Rust derive(From) macro
It only works for tuple structs with one element (newtypes) or enums containing
these tuple structs. The types wrapped by these tuple structs can than simply be
converted by using the .into()
method.
For enums no from code will be generated for types that occur multiple times since this would be ambiguous.
It can simply be used like this:
;
The resulting code that will be compiled will look like this:
;
Because of this and Rust its built in type inference the following can be done now: