In a large code base I am changing the implementation of a component used all over the place. Many, many structs contain instances of it.
Lets say its
pub struct Engine{
thing: Widget,
.....
}
and users of it have
struct Woosh{
engine : Engine,
...
}
The new implementation uses a widget (from a component library) thats like this
pub struct Widget2<'a>{
goop: Stuff<'a>,
....
}
so I have
pub struct Engine{
thing: Widget2
...
}
but of course that doesnt work it has to be
pub struct Engine<'a>{
thing: Widget2<'a>
...
}
But now all my callers have to change too
struct Woosh<'a>{
engine : Engine<'a>,
...
}
and their callers and so on, I Have to touch a huge percentage of the code base for what should have been a transparent implementation switch down in the engine room.
Is there anyway to chop off that 'a
chain. I know I can do it if I change Widget2 and get rid of whats causing it to need the lifetime specifier, but that not my code