#structure #dumb #generate #fields #call #original #public

macro derive_dumb

Derive Dumb generates a structure in which all fields are public. Original structure can be converted using function call dumb.

6 releases

0.2.4 Oct 25, 2023
0.1.4 Jan 21, 2020

#537 in Procedural macros

34 downloads per month

MIT/Apache

4KB
51 lines

Description

Derive Dumb generates a structure in which all fields are public. Original structure can be converted using function call dumb.

Example

#[derive(Dumb)]
pub struct A {
    a: String,
}

Generates:

pub struct DumbA {
    pub a: String,
}
impl A {
    fn dumb(self) -> DumbA {
        DumbA {
            a: self.a,
        }
    }
}

Dependencies

~1.5MB
~33K SLoC