-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/macros: Have
labels!
accept any type that implements Display
This allows (among other things) `histogram_opts!` to take the same kinds of types as `opts!`. E.g. to replace this: ```rust let status = String::from("200"); histogram_opts!( ... labels! {"status".to_string() => status.clone()} ) // Do more stuff with `status`. ``` with this: ```rust let status = String::from("200"); histogram_opts!( ... labels! {"status" => &status} ) // Do more stuff with `status`. ``` And a lot more, such as using numbers or enums as label values directly. Signed-off-by: Alin Sinpalean <[email protected]>
- Loading branch information
1 parent
b7be575
commit af94a02
Showing
1 changed file
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters