Suppose I've got a type TypeA
, and a TypeB
that includes it. TypeB delegates some methods to TypeA
struct TypeB {
value: TypeA,
}
impl TypeB {
fn do_something(&self, data: &str) -> SomeResult {
self.value.do_something(data)
}
}
What effect does this kind of delegation have on performance? Is the compiler smart enough to inline this kind of thing without being told?