Closed bencord0 closed 4 years ago
As per RFC2113 &dyn Trait syntax is now the preferred idiom for many of the use-cases we have for passing the Backends around.
&dyn Trait
https://github.com/rust-lang/rfcs/blob/master/text/2113-dyn-trait-syntax.md#the-current-syntax-is-often-ambiguous-and-confusing
For us, this means that patterns such as
fn func<T: CachedBackend + ?Sized>(backend: &T)
becomes
fn func(backend: &dyn CachedBackend)
The ?Sized trait bound can also be removed. In most areas of the code, we use Boxed trait objects, which are Sized.
?Sized
Sized
As per RFC2113
&dyn Trait
syntax is now the preferred idiom for many of the use-cases we have for passing the Backends around.https://github.com/rust-lang/rfcs/blob/master/text/2113-dyn-trait-syntax.md#the-current-syntax-is-often-ambiguous-and-confusing
For us, this means that patterns such as
becomes
The
?Sized
trait bound can also be removed. In most areas of the code, we use Boxed trait objects, which areSized
.