cocoa-purity

Crates.iococoa-purity
lib.rscocoa-purity
version0.1.1
sourcesrc
created_at2023-04-28 20:56:55.913264
updated_at2023-04-28 20:58:42.745292
descriptionSimple macro collection
homepage
repositoryhttps://github.com/nerodono/cocoa-purity
max_upload_size
id851704
size9,236
(kvxmmu)

documentation

README

cocoa-purity

cocoa-purity is a collection of the useful procedural macros.

P.S. named after the beautiful cat Cocoa

Example

map_enum

use cocoa_purity::map_enum;

#[derive(Debug)]
pub enum Quirk {
    AbilityToSleep,
    Nothing,
}

#[map_enum(Quirk)]
pub enum Character {
    Nero = AbilityToSleep,
    Custom { name: &'static str } = Nothing
}

let nero = Character::Nero;
let custom = Character::Custom { name: "Friend" };

let nero_quirk: Quirk = nero.into();
let custom_quirk: Quirk = custom.into();

dbg!(nero_quirk, custom_quirk);

Commit count: 6

cargo fmt