Skip to content

Commit f437d2b

Browse files
authored
Use no_std if the reload feature is not enabled (#63)
1 parent a953a39 commit f437d2b

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
cargo test --all --features axum
4242
cargo test --all --features reload
4343
44+
- run: |
45+
rustup target add thumbv6m-none-eabi
46+
cargo build --no-default-features --target thumbv6m-none-eabi
47+
4448
lint:
4549
runs-on: ubuntu-latest
4650

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ci:
77
cargo test --all
88
cargo test --all --features axum
99
cargo test --all --features reload
10+
cargo build --no-default-features --target thumbv6m-none-eabi
1011

1112
# publish current GitHub master branch
1213
publish:

src/escape.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ mod tests {
6868
core::fmt::{self, Display},
6969
};
7070

71+
#[cfg(not(feature = "reload"))]
72+
use alloc::string::ToString;
73+
7174
struct Wrapper(&'static str);
7275

7376
impl Display for Wrapper {

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,11 @@
650650
//! ");
651651
//! ```
652652
653+
#![cfg_attr(not(feature = "reload"), no_std)]
654+
655+
#[cfg(not(feature = "reload"))]
656+
extern crate alloc;
657+
653658
pub use {
654659
self::escape::{Escape, Trusted},
655660
boilerplate_macros::{boilerplate, Boilerplate},

0 commit comments

Comments
 (0)