Data::<T>::into_inner requires T: Sized
unnecessarily
#2403
Labels
A-web
project: actix-web
C-improvement
Category: an improvement to existing functionality
good-first-issue
easy to pick up for newcomers
Expected Behavior
I have some code that currently looks something like:
However, this fails to compile since
into_inner
is only implemented forData<T>
(which has an implicitSized
bound onT
).Current Behavior
The above example doesn't compile since
into_inner
is only implemented forData<T>
(which has an implicitSized
bound onT
). Instead, the handler has to call:to retrieve an owned
Arc<dyn MyTrait>
. This is both harder to read and unnecessary cloning.Possible Solution
into_inner
should be in animpl Data<T: ?Sized>
block instead ofimpl Data
.The text was updated successfully, but these errors were encountered: