macron-impl-into

Crates.iomacron-impl-into
lib.rsmacron-impl-into
version0.1.1
created_at2025-04-06 15:00:14.672718+00
updated_at2025-05-25 04:17:23.829672+00
descriptionThe implementation of trait Into
homepage
repositoryhttps://github.com/fuderis/rs-macron/tree/main/macron-impl-into
max_upload_size
id1622978
size9,224
Bulat Sh. (fuderis)

documentation

README

githubcrates-iodocs-rs

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.

Commit count: 15

cargo fmt