-
-
Notifications
You must be signed in to change notification settings - Fork 15
feat: Add key/value pair QoL improvements #711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Just so I understand it correctly, does that mean instead of: let labels: Labels =
BTreeMap::from([("k", "v")])
.try_into()
.context(BuildLabelSnafu)?; I would now do: let labels = Labels::try_from([("k", "v")])
.context(BuildLabelSnafu)?; Edit: I see the test that basically shows my second version |
Yes! See Lines 335 to 343 in 1c444b6
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! This is immediately useful (thought probably in the next round of operator maintenance)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR adds two QoL improvements to the key/value pair API:
TryFrom<[(K, V); N]>
impl for labels and annotationsLabels::parse_insert()
andAnnotations::parse_insert()
functions. They takeimpl TryInto<_>
as a parameter.