Commit Graph

4 Commits

Author SHA1 Message Date
Martin Habovstiak 2b6bcf085c Implement support for `alloc`-free parse errors
This implements basic facilities to conditionally carry string inputs in
parse errors. This includes:

* `InputString` type that may carry the input and format it
* `parse_error_type!` macro creating a special type for parse errors
* `impl_parse` implementing parsing for various types as well as its
  `serde`-supporting alternative
2023-06-04 21:15:37 +02:00
Martin Habovstiak 783e1e81dc Move `impl_std_error` to `bitcoin-internals`
The macro is useful for all other crates thus it is moved to the
internals crate in this commit.
2023-05-30 18:04:54 +02:00
Tobin C. Harding 1c3bbd4bf2
internals: Remove attribution from all files
As we did for the `bitcoin` crate, remove attribution from all files in
the `internals` crate.

While we are at it add an SPDX line to the few files missing it, whether
this license nonsense is even needed is left as an argument for another
day.

Justification:

Currently we have a mishmash of attribution lines accompanying the SPDX
identifier. These lines are basically meaningless because:

    - The date is often wrong
    - The original author attributed is not the only contributor to a file
    - The term "rust bitcoin developers" is basically just noise

Just remove all the attribution lines and be done with it.
2023-05-01 09:31:42 +10:00
Tobin C. Harding 834bbf461f Introduce bitcoin-internals crate
Add a new crate `bitcoin-internals` to be used for internal code needed
by multiple soon-to-be-created crates.

Add the `write_err` macro to `bitcoin-internals`, nothing else.

This patch uses a `path` dependency which means `rust-bitcoin` cannot be
released in its current state, will need to be changed once we release
the `bitcoin-internals` crate on `crates.io`.
2022-09-13 08:59:57 +10:00