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

decode_to_slice requires a global_allocator to be configured #5

Open
leighmcculloch opened this issue Oct 7, 2023 · 1 comment
Open

Comments

@leighmcculloch
Copy link

I'm using v2.0.0, with the following Cargo.toml config:

[dependencies]
base64-url = {version= "2.0.0", default-features = false}

And the code is using this one function:

base64_url::decode_to_slice(...)

When I use this in a build that has no global_allocator, I see the following error:

error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait
@magiclen
Copy link
Owner

The alloc feature of the base64 crate is always enabled. You can try to use the base64 crate directly without activate the alloc feature.

base64::engine::general_purpose::URL_SAFE_NO_PAD.decode_slice(input, output)

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

No branches or pull requests

2 participants