convert-chain
A tiny crate for chain type converter. There is only one macro convert_chian
in it
Assuming there are 3 sturct with following relationship.
;
;
;
You can use the macro to directly convert an expression or create a closure for the convert.
-
Directly convert
let c = C; let a = convert_chain!;
-
Create a closure
let c = C; let f = convert_chain!; let a = f;
Both of the above methods are equivalent to
let c = C;
let a = from;