Remove generics from Error by making fragment a String#642
Remove generics from Error by making fragment a String#642apoelstra merged 1 commit intorust-bitcoin:masterfrom
Conversation
8ec4156 to
15dd431
Compare
|
When no-std is on you need to explicitly import But concept ACK doing this. It seems like an improvement to me. Eventually we should go over all the error types like we have been doing with rust-bitcoin. |
|
One day I'd love to get time (ie months) to focus on |
15dd431 to
fa27b7d
Compare
|
no-std fixed |
|
I fixed CI in #645. I'd like to get that in and rebase this because it's the kind of thing that we want CI to be passing for. |
fa27b7d to
6994dc9
Compare
|
rebased to take #645 |
|
Looks like you need to run |
6994dc9 to
f4b9814
Compare
done It's still broken on nightly which seems to have |
|
When Meanwhile to deal with it you just need to make sure your imports are feature-gated on nostd. |
This cause a reduction of IR lines emitted by the compiler of about 2% (using cargo llvm-lines), so this should improve compile times. I've seen using the parse example to check the produced binary size, but it's a small snippet I am not sure it calls a representative portion of the API surface. From a library perspective this is equivalent since the field is used only to be converted to string. In theory externally someone could use the field in the error to do things so it comes at a cost.
|
ah right the same you did here |
|
cc @sanket1729 can you concept-ACK this? |
|
On further thought I'm just going to merge this. I have some bigger ideas about how to handle errors in this crate, and getting rid of these generics will make future refactoring much easier. |
… making fragment a String
0afd8324dfb1fb0850efc6edfc3a554c4dcddd45 Remove generics from Error by making fragment a String (Riccardo Casatta)
Pull request description:
This cause a reduction of IR lines emitted by the compiler of about 2% (using cargo llvm-lines), so this should improve compile times.
I've seen using the parse example to check the produced binary size, but it's a small snippet I am not sure it calls a representative portion of the API surface.
From a library perspective this is equivalent since the field is used only to be converted to string.
In theory externally someone could use the field in the error to do things so it comes at a cost.
ACKs for top commit:
apoelstra:
ACK 0afd8324dfb1fb0850efc6edfc3a554c4dcddd45
Tree-SHA512: f6980ee43f93278f0c7dcf5000e67d1e201549a77996bc66c144ea978d3820debbb82a082ad9e2b9a57d91e62a879268e8c914b4e922bd1619e0f0763916b1ea
This cause a reduction of IR lines emitted by the compiler of about 2% (using cargo llvm-lines), so this should improve compile times.
I've seen using the parse example to check the produced binary size, but it's a small snippet I am not sure it calls a representative portion of the API surface.
From a library perspective this is equivalent since the field is used only to be converted to string.
In theory externally someone could use the field in the error to do things so it comes at a cost.