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

add no_std support #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevefan1999-personal
Copy link

@stevefan1999-personal stevefan1999-personal commented Sep 23, 2023

Fixes #19

stable = ["include-flate-codegen-exports/stable"]
std = ["include-flate-codegen-exports/std", "libflate/std", "core2/std"]
Copy link
Owner

Choose a reason for hiding this comment

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

Please preserve the trailing newlines

@@ -26,6 +26,10 @@
//! which might be undesirable if the data are too large.
//! An actual installer is still required if the binary involves too many resources that do not need to be kept in RAM all time.

#![cfg_attr(not(any(test, feature = "std")), no_std)]
Copy link
Owner

Choose a reason for hiding this comment

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

Do we really need a feature gate for this? #![no_std] should be usable in binaries compiled with std as well.

pub type String = ::std::string::String;

#[cfg(not(feature = "std"))]
pub type String = ::alloc::string::String;
Copy link
Owner

Choose a reason for hiding this comment

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

::std::string::String is an alias of ::alloc::string::String, why do we need to differentiate them?

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.

no-std support
2 participants