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

Support For No-std #36

Open
aruokhai opened this issue Jul 22, 2024 · 1 comment · May be fixed by #38
Open

Support For No-std #36

aruokhai opened this issue Jul 22, 2024 · 1 comment · May be fixed by #38

Comments

@aruokhai
Copy link
Contributor

Objective

The addition of no_std support would effectively improve the range of usage of the coinselect library. It is quite advantageous at this point that very little external dependencies exist , in this light it would be quite straight forward for the support of no_std environment to be implemented.

Changes Required

A require change is the inclusion of the attribute in the lib.rs file

#![no_std]

#[cfg(feature = "std")]
extern crate std;

which ensures that no_std is the default state.

In the toml file we need to ensure no_std for the rand dep is recognised with such lines :

[dependencies]
rand = { version = "0.8.5", default-features = false , features = ["alloc"] }

[features]
std = ["rand/std"]

This is also required for functions that requires std functionalities

#[cfg(feature = "std")]

pub fn function_that_requires_std() {
    // ...
}

@aruokhai
Copy link
Contributor Author

aruokhai commented Jul 22, 2024

I would begin working on it which i believe the code might clarify future questions.

@aruokhai aruokhai linked a pull request Aug 6, 2024 that will close this issue
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 a pull request may close this issue.

1 participant