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

Fix compilation on no_std. #49

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ name: Rust

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
feature-args:
- ''
- --no-default-features --features alloc
- --no-default-features
steps:
- uses: actions/checkout@v2
- name: Install libudev
Expand All @@ -25,6 +27,6 @@ jobs:
override: true
components: rustfmt, clippy
- name: Build
run: cargo build --verbose
run: cargo build --verbose ${{ matrix.feature-args }}
- name: Run tests
run: cargo test --verbose
run: cargo test --verbose ${{ matrix.feature-args }}
1 change: 1 addition & 0 deletions ublox_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ proc-macro = true
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0.14", features = ["extra-traits", "full"] }

[dev-dependencies]
which = { version = "3.0", default-features = false }
proc-macro2 = { version = "1.0", features = ["span-locations"] }
1 change: 1 addition & 0 deletions ublox_derive/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ pub fn generate_send_code_for_packet(pack_descr: &PackDesc) -> TokenStream {
} else {
ret.extend(quote! {
impl #payload_struct_lifetime #payload_struct #payload_struct_lifetime {
#[cfg(feature = "alloc")]
#[inline]
pub fn into_packet_vec(self) -> Vec<u8> {
let mut vec = Vec::new();
Expand Down