-
Notifications
You must be signed in to change notification settings - Fork 145
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
Using no_std + alloc #279
Using no_std + alloc #279
Conversation
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.
Thanks for the PR!
Happy to merge this once the issues above are resolved.
BTW, if you'd like a quicker turnaround next time, I recommend running cargo test --workspace --all-features
locally before sending the PR. That should catch most of these issues.
maud/src/lib.rs
Outdated
// So that unit tests can use `std` | ||
#[cfg(test)] | ||
#[macro_use] | ||
extern crate std; |
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.
Can we remove this? This module doesn't define any unit tests afaik.
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.
This was updated to re-enable std for rocket and iron support.
maud/src/lib.rs
Outdated
@@ -168,11 +179,11 @@ pub const DOCTYPE: PreEscaped<&'static str> = PreEscaped("<!DOCTYPE html>"); | |||
#[cfg(feature = "iron")] | |||
mod iron_support { | |||
use crate::PreEscaped; | |||
use core::io; |
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.
Does this work?
I'm pretty sure core
doesn't have an io
module.
You might want to disable no_std
when these web framework features are enabled, since they require std
anyway.
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.
I didn't find a way to optionally disable no_std
, only a way to optionally enable it.
Removed references to `std` and replaced them with references to `core` and `alloc`. Features `rocket` and `iron` still require `std`.
588c22f
to
1c0129a
Compare
Ah, this would have been helpful. I'll open a second PR for updating the |
@lambda-fairy CI should pass. Let me know if there are other changes you'd like. |
This avoids duplicating the feature flag checks.
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.
LGTM (with a couple minor fixes I made myself)
Thanks again @halzy!
Oh, I notice GitHub requires maintainer approval before it runs CI. I've changed it to run automatically instead. |
Removed references to
std
and replaced them with references tocore
andalloc
.Tests still use
std
.