Struple
Derive a trait for tuple <-> struct conversion for your own struct.
Basic example
use Struple
;
Use cases
The main reason as to why I made this crate is because of nom and it's tuple parser combinator. This combinator allows easy chaining of serveral parsers in sequence but has the downside that you gotta destructure the tuple manually to put the data into the corresponding struct. This is cumbersome and bloats the code(at least in my opinion). With this one can just derive a tuple constructor for the struct and pass that constructor to the map function to map the tuple to the struct. It even allows to create a new combinator just for this:
// with struple
let : = struple?;
// without struple
let = map?;