2 releases

0.1.1 Nov 29, 2023
0.1.0 Nov 29, 2023

#1127 in Procedural macros

MIT license

4KB
74 lines

better-rs

goal: rustcoed make better

new constructor

use better;

#[derive(Debug)]
struct Asdf{
    a: isize,
    b: isize,
}

#[better::new]
impl Asdf {
    fn new(a: isize, b: isize) -> Asdf{
        Asdf { a: a + 1, b: b + 1 }
    }
    fn a(&self) -> isize{
        self.a
    }
}


fn main() {
    let a = Asdf();
    println!("{:?}", a);
    
}

Dependencies

~2.3–4MB
~69K SLoC