Closed vorner closed 6 years ago
You could make it generic, ie. Swap<T: RefCounted>
and have ArcSwap
be an alias, and also implement RefCounted
for Option<Arc<T>>
That's actually a nice idea. And it could be also implemented (under a feature) for all these Arc
s from other crates without weak counts, etc.
Implemented and released as part of 0.2
It could sometimes be desirable to represent empty state. eg. some form of NULL. On the other hand, every user would then need to explicitly handle the NULL case even if it doesn't happen for them. Is it worth?