2 releases
| 0.1.1 | May 25, 2025 |
|---|---|
| 0.1.0 | Apr 6, 2025 |
#5 in #proc-derive
127 downloads per month
Used in 8 crates
(via macron)
7KB
76 lines
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.
Dependencies
~140–540KB
~13K SLoC