Skip to content

Commit

Permalink
Fix compilation on no_std.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Nov 23, 2022
1 parent 5b34387 commit c1a02fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
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

0 comments on commit c1a02fb

Please sign in to comment.