Skip to content
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

Add constructor to abci::tag::{Key, Value} #1217

Closed
plafer opened this issue Oct 26, 2022 · 2 comments
Closed

Add constructor to abci::tag::{Key, Value} #1217

plafer opened this issue Oct 26, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@plafer
Copy link
Contributor

plafer commented Oct 26, 2022

Description

Currently, Key and Value can only be built with FromStr. When we have a String, we are forced to do let key: Key = string.parse().unwrap() (e.g. here).

It would make it cleaner to have a fn new(s: String) -> Self constructor.

Definition of "done"

Key and Value have a fn new(s: String) -> Self constructor.

@tony-iqlusion
Copy link
Collaborator

If there's no invariant being enforced, you might as well make the inner String member of the newtype tuple struct pub, rather than adding an infallible constructor.

@mzabaluev
Copy link
Contributor

#1204 did away with these types.

@mzabaluev mzabaluev closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants