Skip to content

Fix feature=alloc build #90

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions packed_struct/src/internal_prelude/no_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ pub use core::hash::{Hash, Hasher};
pub use alloc::vec::Vec;
#[cfg(feature="alloc")]
pub use alloc::borrow::Cow;
#[cfg(feature="alloc")]
pub use alloc::fmt::Formatter;

2 changes: 0 additions & 2 deletions packed_struct/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,6 @@

#![cfg_attr(not(feature = "std"), no_std)]

#![cfg_attr(feature="alloc", feature(alloc))]

extern crate packed_struct_codegen;

#[cfg(feature="alloc")]
Expand Down
1 change: 1 addition & 0 deletions packed_struct_codegen/src/pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub struct FieldMidPositioning {
pub bits_position: BitsPositionParsed,
}

#[allow(clippy::large_enum_variant)]
pub enum FieldKind {
Regular {
ident: syn::Ident,
Expand Down
2 changes: 2 additions & 0 deletions packed_struct_codegen/src/pack_codegen_docs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::to_string_in_format_args)]

use crate::pack::*;
use crate::common::*;
use proc_macro2::Span;
Expand Down
2 changes: 2 additions & 0 deletions packed_struct_codegen/src/pack_parse.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::to_string_in_format_args)]

extern crate quote;
extern crate syn;

Expand Down
2 changes: 1 addition & 1 deletion packed_struct_codegen/src/pack_parse_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub fn parse_position_val(v: &str, multiplier: usize) -> Result<BitsPositionPars
let n = parse_num(&v)?;
return Ok(BitsPositionParsed::Start(n * multiplier));
} else if v.ends_with(':') {
let v = v.replace(":", "");
let v = v.replace(':', "");
let n = parse_num(&v)?;
return Ok(BitsPositionParsed::Start(n * multiplier));
} else if v.contains(':') || v.contains("..=") {
Expand Down