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 so rc-zip can be used in embedded enviroments. #98

Open
jacobguenther opened this issue Feb 9, 2025 · 0 comments
Open

Comments

@jacobguenther
Copy link

Motivation:
Reading zip files on SD cards on micro controllers.

Work Required:
The only non optional dependency that actually needs the standard library is oval. I haven't looked at the optional dependencies yet. All of the other dependencies have a feature flag "std" enabled by default which can be disabled.

Oval is a very small library and could be re-implemented to not use the std library. It relies on std::io::{Read, Write, Result}. These could be replaced with embedded_io Read Write and Error. The core library does not have traits for Read and Write.

A new feature would need to be added, normally called "std". And enabled by default.

Something like
`
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::borrow::Cow;
#[cfg(feature = "std")]
use std::borrow::Cow;

#[cfg(not(feature = "std"))]
use core::cmp;
#[cfg(feature = "std")]
use std::cmp;
`
would have to be done. Or just use the core library.

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

1 participant