You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that it's not possible to overwrite get with get_copy, e.g.
use getset::{CopyGetters,Getters};#[derive(Getters,CopyGetters)]#[get = "pub"]structFoo{a:String,b:String,c:String,#[get_copy = "pub"]d:u64,}
doesn't compile with
error[E0592]: duplicate definitions with name `d`
--> src/main.rs:3:19
|
3 | #[derive(Getters, CopyGetters)]
| ------- ^^^^^^^^^^^ duplicate definitions for `d`
| |
| other definition for `d`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
For more information about this error, try `rustc --explain E0592`.
error: could not compile `foo`
The workaround is to use field level attributes on every property:
use getset::{CopyGetters,Getters};#[derive(Getters,CopyGetters)]structFoo{#[get = "pub"]a:String,#[get = "pub"]b:String,#[get = "pub"]c:String,#[get_copy = "pub"]d:u64,}
The text was updated successfully, but these errors were encountered:
Hey @Hoverbear, thanks for this handy crate 😸
I noticed that it's not possible to overwrite
get
withget_copy
, e.g.doesn't compile with
The workaround is to use field level attributes on every property:
The text was updated successfully, but these errors were encountered: