Skip to content
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

types: Add std feature #44

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Conversation

tcharding
Copy link
Member

@tcharding tcharding commented Jan 22, 2025

master is currently broken because the linter is warning because of a std feature (which is coming from our usage of internals::write_err).

We can fix this breakage after observing that calling macros from other crates is error prone. Lets copy the macro. On the way add a std feature and stop using HashMap.

This also allows the removal of the internals dependency. Sexy PR right here.

Close: #12

We would like to be able to use `types` in a no-std environment. The
`HashMap` type is only available in `std` builds. `BTreeMap` lives in
the `alloc` crate - use it instead.
There is no reason we cannot support non-std users. Lets keep the alloc
requirement though.

Add `std` feature and enable it by default.
Currently we have a dependency on `bitcoin_internals` just for the
`write_err` macro.

Copy the macro here and remove the dependency. Make the macro and module
private.
@tcharding
Copy link
Member Author

@apoelstra your local CI should be able to chew through this now mate.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3a72c19; successfully ran local tests

@apoelstra apoelstra merged commit 6d3be0a into rust-bitcoin:master Jan 22, 2025
27 checks passed
@tcharding
Copy link
Member Author

Mad! thanks man

@tcharding tcharding deleted the 01-22-lint branch January 23, 2025 00:36
@tcharding tcharding changed the title Add std feature types: Add std feature Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable no-std for types crate
2 participants