Skip to content

Commit 2e3d864

Browse files
authored
Merge pull request #56 from hashmismatch/large_bit_types_features
Revert back by default to generating up to 32 byte arrays
2 parents 77f0bd9 + 74c53f6 commit 2e3d864

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packed_struct/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ default-features = false
2323
default = ["std"]
2424
std = ["serde/std"]
2525
alloc = []
26+
byte_types_64 = []
27+
byte_types_256 = []
2628

2729
# comment this section when publishing new releases to crates.io!
2830
[dev-dependencies]

packed_struct/build.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ fn main() {
1212
let dest_path = Path::new(&out_dir).join("generate_bytes_and_bits.rs");
1313
let mut f = File::create(&dest_path).unwrap();
1414

15-
let up_to_bytes = 256;
15+
let up_to_bytes =
16+
if cfg!(feature = "byte_types_256") {
17+
256
18+
} else if cfg!(feature = "byte_types_64") {
19+
64
20+
} else {
21+
32
22+
};
1623

1724
// bytes
1825
for i in 0..(up_to_bytes + 1) {

packed_struct_tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ authors = ["Rudi Benkovic <[email protected]>"]
55
publish = false
66

77
[dependencies]
8-
packed_struct = "0.4"
8+
packed_struct = { version = "0.4", features = ["byte_types_64"] }
99
packed_struct_codegen = "0.4"
1010
error-chain = "0.12.0"

0 commit comments

Comments
 (0)