-
Notifications
You must be signed in to change notification settings - Fork 1
Add no_std support #1
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
Conversation
WalkthroughThe crate switches to no_std by adding crate-level attributes in src/lib.rs: enabling #![no_std] and importing extern crate alloc. No module structure or public APIs are changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib.rs (1)
100-116
: Tests will fail under pure no_std because Vec isn’t in scopeIf you keep unconditional no_std, the test module uses Vec without importing it (Vec isn’t in the core prelude). Either adopt the change above or import Vec from alloc here.
Apply (only needed if you keep no_std unconditionally):
#[cfg(test)] mod tests { - use super::*; + use super::*; + use alloc::vec::Vec;
🧹 Nitpick comments (1)
src/lib.rs (1)
1-2
: Gate no_std during tests and drop unnecessary alloc dependencyUnconditionally enabling no_std and importing alloc forces an unnecessary requirement on targets without an allocator and complicates testing. Prefer enabling no_std only outside tests so unit tests can use std seamlessly.
Apply:
-#![no_std] -extern crate alloc; +#![cfg_attr(not(test), no_std)]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/lib.rs
(1 hunks)
by @Masterchef365
Summary by CodeRabbit