How to extend multiple types

I currently have a "composed type" that is passed around a lot in my program which is Arc<RwLock<Vec<Metadata>>>.
Is there a way to condense this long nested type into a simple one for ease to use through out the program?

Something like type Lock = Arc<RwLock<Vec<Metadata>>>

Yes, you can literally write

type Lock = Arc<RwLock<Vec<Metadata>>>;

Although I would use a different name personally, maybe SharedMetadata or something.

3 Likes

:sweat_smile: Thankss Cole!

1 Like