rust-bitcoin / rust-bech32-bitcoin

Encoding and decoding Segregated Witness addresses in Bech32 format
16 stars 25 forks source link

Minor QOL fixes #34

Open nappa85 opened 2 years ago

nappa85 commented 2 years ago

Those changes aren't groundbreaking. One avoids allocating a new String every time a Network is converted to his string representation, a user can always call to_owned or clone on the static string to get the owned String. The other one returns a reference to Network instead of copying it every time, I feel this is more correct since, for example, constants::hrp asks for a reference, therefore we can short circuit the two things without creating a temporary reference to a temporary copy only for this