-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove generics from Error by making fragment a String #642
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 0afd832
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. |
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.