Skip to content

Commit 0834e29

Browse files
committed
Test no-std compatibility
1 parent f437d2b commit 0834e29

File tree

6 files changed

+42
-3
lines changed

6 files changed

+42
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ jobs:
4343
4444
- run: |
4545
rustup target add thumbv6m-none-eabi
46-
cargo build --no-default-features --target thumbv6m-none-eabi
46+
cargo build --target thumbv6m-none-eabi --package boilerplate
47+
cargo build --target thumbv6m-none-eabi --package boilerplate-tests
4748
4849
lint:
4950
runs-on: ubuntu-latest

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/boilerplate-macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn boilerplate(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
2828
use ::core::fmt::Write;
2929

3030
let boilerplate_text = &[ #(#text),* ];
31-
let mut boilerplate_output = ::std::string::String::new();
31+
let mut boilerplate_output = ::alloc::string::String::new();
3232

3333
#body
3434

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "boilerplate-tests"
3+
version = "0.0.0"
4+
authors.workspace = true
5+
categories.workspace = true
6+
edition.workspace = true
7+
homepage.workspace = true
8+
license.workspace = true
9+
repository.workspace = true
10+
11+
[dependencies]
12+
boilerplate = { path = "../../" }
13+
14+
[lints]
15+
workspace = true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![no_std]
2+
3+
extern crate alloc;
4+
5+
#[allow(unused)]
6+
#[derive(boilerplate::Boilerplate)]
7+
#[boilerplate(text = "Hello, {{ self.name }}!")]
8+
struct Context {
9+
name: &'static str,
10+
}
11+
12+
#[allow(unused)]
13+
fn foo() {
14+
boilerplate::boilerplate!("Hello!");
15+
}

justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ 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
10+
cargo build --target thumbv6m-none-eabi --package boilerplate
11+
cargo build --target thumbv6m-none-eabi --package boilerplate-tests
1112

1213
# publish current GitHub master branch
1314
publish:

0 commit comments

Comments
 (0)