Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, `Layered` only implements `fmt::Debug` if the outer layer, the inner layer, *and* the subscriber type parameters all implement `fmt::Debug`. However, in the case of a `Layered` with two `Layer`s, the subscriber itself is not present --- it's only a `PhantomData`. So the `fmt::Debug` implementation should be possible when only the actual `layer` and `inner` values are `Debug`. For the `PhantomData`, we can just print the type name. This means that `Layered` consisting of two `Layer`s and no `Subscriber` will now implement `Debug` if the `Layer`s are `Debug`, regardless of the subscriber type. When the `Layered` is a `Layer` and a `Subscriber`, the behavior will be the same, because the separate `PhantomData` subscriber type param is always the same as the type of the inner subscriber. Because printing the whole type name of the subscriber is potentially verbose (e.g. when the subscriber itself is a big pile of layers), we only include it in alt-mode.
- Loading branch information