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

It would be useful if get_maximum_output_size() were a const function #152

Closed
hellertime opened this issue Mar 29, 2024 · 1 comment · Fixed by #153
Closed

It would be useful if get_maximum_output_size() were a const function #152

hellertime opened this issue Mar 29, 2024 · 1 comment · Fixed by #153

Comments

@hellertime
Copy link

It appears there is nothing that prevents get_maximum_output_size from being declared const, and if it were then it should be possible to use it in array initializers:

let buf = [u8; lz4_flex::block::compress::get_maximum_output_size(&input)];

@PSeitz
Copy link
Owner

PSeitz commented Mar 30, 2024

Seems like a good idea if you know the size of your input, released with 0.11.3.

Stack allocation may be slower tough in some cases.

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.

2 participants