Luro02 / shorthand

A proc-macro to derive getter, setter and mut getter for structs in rust.
Apache License 2.0
6 stars 0 forks source link

primitive_copy ignored, when option_as_ref is enabled #20

Closed Luro02 closed 4 years ago

Luro02 commented 4 years ago

There is a bug, where a primitive type is not copied, when they are wrapped in an Option and option_as_ref is enabled:

#[derive(ShortHand)]
struct Example {
   value: Option<usize>,
}

generates

fn value(&self) -> Option<&usize>;

but it should generate

fn value(&self) -> Option<usize>;