Skip to content

Commit

Permalink
add 'explicit' restriction. (#12643)
Browse files Browse the repository at this point in the history
Commit Message: The intent, when providing Stats::Utility::counterFromElements, is that dynamic segments should be easy to construct, but still searchable. We should be trying to avoid dynamic segments whenever possible, so having them implicitly created from string data is not idea.
Additional Description:
Risk Level: none for the repo, but possibly will require trivial edits outside the repo
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
  • Loading branch information
jmarantz authored Aug 14, 2020
1 parent 5a602e8 commit 630511e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/common/stats/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DynamicName : public absl::string_view {
// This is intentionally left as an implicit conversion from string_view to
// make call-sites easier to read, e.g.
// Utility::counterFromElements(*scope, {DynamicName("a"), DynamicName("b")});
DynamicName(absl::string_view str) : absl::string_view(str) {}
explicit DynamicName(absl::string_view str) : absl::string_view(str) {}
};

/**
Expand Down

0 comments on commit 630511e

Please sign in to comment.