Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subscriber: fix
Layered
layers not downcasting to themselves
Currently, a `Layered` struct's implementations of `Subscriber` and `Layer` will successfully downcast to either the the `Layer` type or the inner type, but *not* to `Layered<Layer, Inner>`. This means that when a `Layer` tries to downcast the wrapped subscriber to a known type, and it is a `Layered` (so, any time more than one layer wraps a subscriber and a layer other than the first one tries to downcast to the inner type it wraps), the downcast will fail incorrectly. This commit fixes the issue by checking if the downcast target `TypeId` equals the `Layered` type's `TypeId`, _before_ trying to downcast to the layer itself or to the inner type. Signed-off-by: Eliza Weisman <[email protected]>
- Loading branch information