
Impl Into Macro
Introduction:
The implementation of trait Into.
P.s.: More useful macros you can find here.
Examples:
#[derive(Into, Debug, PartialEq)]
#[into(Insertion, "self.insertion")]
struct Test {
insertion: Insertion,
}
#[derive(Debug, PartialEq)]
struct Insertion;
assert_eq!(Insertion {}, Test { insertion: Insertion {} }.into());
#[derive(Into, Debug, PartialEq)]
#[into(Insertion, "match self { Self::Insertion(ins) => ins }")]
enum Test {
Insertion(Insertion),
}
#[derive(Debug, PartialEq)]
struct Insertion;
assert_eq!(Insertion {}, Test::Insertion(Insertion {}).into());
Licensing:
Distributed under the MIT license.
Feedback:
You can contact me via GitHub or send a message to my Telegram @fuderis.
This library is constantly evolving, and I welcome your suggestions and feedback.