Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows the use of trait object
WordSplitter
in Wrapper
.
This commit presents a minimal solution for mgeisler#178 which is yet quite flexible (as it allows using Box & Rc & others), as well as being fairly minimal, mostly, it is just relaxing trait bounds, thus this is even backwards compatible. In summary, this committ just relaxes the trait bound on the type parameter of `Wrapper`, to allow unsized `WordSpiltter`. While it is practically impossible to construct a `Wrapper` with unsized `WordSpiltter`, once a sized one has been created, and wrapped in some pointer type (such as Box), it can be coerced into e.g. `Box<Wrapper<dyn WordSpiltter>>` replacing the type parameter by a trait object.
- Loading branch information