subscriber: move fmt::LayerBuilder
methods to fmt::Layer
#655
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
There isn't an actual reason that
fmt::Layer
needs a separate buildertype, since the builder and layer structs are identical and only differ
in what methods they provide. If the methods for configuring a
Layer
were exposed by the
Layer
type instead, it would be simple toconstruct
Layer
s — no need to call.finish()
on the builder.Solution
This commit moves all the
LayerBuilder
methods toLayer
, makesLayerBuilder
a type alias forLayer
, and deprecatesLayer::builder
, theLayerBuilder
type, andLayerBuilder::finish()
.Since nothing has been removed, this shouldn't be a breaking change, but
we can remove the deprecated APIs in 0.3.x.
Signed-off-by: Eliza Weisman eliza@buoyant.io