-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
I have a derived getter, using the getset crate, but I also need to impl a trait that has the same getter.
This works:
#[derive(Getters)]
pub struct Struct {
member: Member,
#[getset(get)]
foo: Foo,
}
impl Trait for Struct {
delegate! {
to self.member {
fn bar(&self) -> Bar;
}
}
fn foo(&self) -> &Foo {
self.foo()
}
}But this doesn't work:
impl Trait for Struct {
delegate! {
to self.member {
fn bar(&self) -> Bar;
}
to self {
fn foo(&self) -> &Foo;
// ^^ error: expected identifier or integer
}
}
}But it should also work, because the handwritten delegation from trait to self.foo() works :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels