Commit Graph

55 Commits

Author SHA1 Message Date
Tobin C. Harding ebeb21fa7a
Import fmt::Write using underscore
When we use the `fmt::Write` trait it is just to call its methods, we
can therefore, without any change to the logic, use `as _` when
importing the trait. This prevents naming conflicts.

Done in preparation for importing the `io::Write` trait.
2023-12-12 11:48:29 +11:00
Tobin C. Harding ae07bdbdbc
Remove ToOwned from prelude
We are not using the `ToOwned` trait, remove it.

Found by clippy.
2023-12-12 08:55:03 +11:00
Tobin C. Harding 396e049a7a
Use InputString instead of String
Done so that we can correctly support builds without an allocator.

Add two new error types that wrap `InputString`.
2023-12-11 08:53:13 +11:00
Tobin C. Harding acacf45edf
Add ParseDenominationError
We have two variants in the `ParseAmountError` that both come from
parsing a denomination, these should be a separate error.
2023-12-11 08:53:11 +11:00
Tobin C. Harding 69e56a64ed
Add bitcoin-units crate
Add a new crate `bitcoin-units`, move the `amount` module over to it and
re-export all types from `bitcoin::amount` so this as not a breaking
change.
2023-12-11 08:52:31 +11:00