informalsystems/tendermint-rs

Add constructor to `abci::tag::{Key, Value}`

plafer opened this issue · 2 comments

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.

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.

#1204 did away with these types.