Skip to content

Commit

Permalink
Release 0.18 (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharksforarms authored Sep 7, 2024
1 parent 8fad609 commit 2d615e4
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 17 deletions.
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# Changelog

## [Unreleased]
- Add attributes `seek_from_start`, `seek_from_current`, `seek_from_end`, and `seek_rewind` to control the position of the reader before reading a field ([#360](https://github.com/sharksforarms/deku/pull/360))

## [0.18.0] - 2024-08-07

Usability
- Reading now requires `Seek`. Attributes such as `seek_from_start`, `seek_from_current`, `seek_from_end`, and `seek_rewind` were added to be able to control the position of the reader before reading a field ([#360](https://github.com/sharksforarms/deku/pull/360))
- Support added for unit structs ([#450](https://github.com/sharksforarms/deku/pull/450))
- `to_slice` was added to write an to a slice ([#461](https://github.com/sharksforarms/deku/pull/461))

Performance
- The use of bits parsing is now an optional feature. If bit-level parsing is not useful for your application, you can disable it to get some performance benefits. ([#446](https://github.com/sharksforarms/deku/pull/446))
- Performance of `read_all` was improved ([#441](https://github.com/sharksforarms/deku/pull/441))

Enum improvements
- Added `id_endian` attribute to specify the endianness of `id` ([#476](https://github.com/sharksforarms/deku/pull/476))
- Support for `bool` literals in enum `id` attribute ([#472](https://github.com/sharksforarms/deku/pull/472))
- `id_pat` attribute was re-introduced ([#454](https://github.com/sharksforarms/deku/pull/454))

## [0.17.0] - 2024-04-23

Expand Down Expand Up @@ -470,7 +485,9 @@ Community:
- Added `release.toml`
- Added `CHANGELOG.md` to track changes

[Unreleased]: https://github.com/sharksforarms/deku/compare/deku-v0.17.0...HEAD
[Unreleased]: https://github.com/sharksforarms/deku/compare/deku-v0.18.0...HEAD

[0.18.0]: https://github.com/sharksforarms/deku/compare/deku-v0.17.0...deku-v0.18.0

[0.17.0]: https://github.com/sharksforarms/deku/compare/deku-v0.16.0...deku-v0.17.0

Expand Down
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ bits = ["dep:bitvec", "deku_derive/bits"]
[dependencies]
deku_derive = { version = "^0.17.0", path = "deku-derive", default-features = false}
bitvec = { version = "1.0.1", default-features = false, optional = true }
log = { version = "0.4.21", optional = true }
log = { version = "0.4.22", optional = true }
no_std_io = { version = "0.8.0", default-features = false, features = ["alloc"], package = "no_std_io2" }
rustversion = "1.0.16"
rustversion = "1.0.17"

[dev-dependencies]
rstest = "0.19.0"
rstest = "0.22.0"
hexlit = "0.5.5"
criterion = "0.5.1"
alloc_counter = "0.0.4"
trybuild = "1.0.95"
rustc-hash = "1.1.0"
env_logger = "0.11.3"
trybuild = "1.0.99"
rustc-hash = "2.0.0"
env_logger = "0.11.5"
assert_hex = "0.4.1"

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ for binary structs or network headers

```toml
[dependencies]
deku = "0.17"
deku = "0.18"
```

no_std:
Expand Down
4 changes: 2 additions & 2 deletions deku-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ syn = "2.0"
# syn = {version = "1.0", features = ["extra-traits"]}
proc-macro2 = "1.0"
darling = "0.20"
proc-macro-crate = { version = "3.1.0", optional = true }
proc-macro-crate = { version = "3.2.0", optional = true }

[dev-dependencies]
rstest = "0.19"
rstest = "0.22"

[lints]
workspace = true
2 changes: 1 addition & 1 deletion ensure_no_std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ alloc = []
[dependencies]
cortex-m-rt = "0.7.3"
deku = { path = "../", default-features = false, features = ["alloc", "bits"] }
embedded-alloc = "0.5.1"
embedded-alloc = "0.6.0"

2 changes: 1 addition & 1 deletion ensure_no_std/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern crate alloc;
use core::panic::PanicInfo;

use cortex_m_rt::entry;
use embedded_alloc::Heap;
use embedded_alloc::LlffHeap as Heap;

#[global_allocator]
static HEAP: Heap = Heap::empty();
Expand Down
2 changes: 1 addition & 1 deletion ensure_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ crate-type = ["cdylib", "rlib"]
default = ["console_error_panic_hook", "wee_alloc"]

[dependencies]
wasm-bindgen = "0.2.92"
wasm-bindgen = "0.2.93"

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
Expand Down
2 changes: 1 addition & 1 deletion src/impls/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ mod tests {
}

#[rstest(input, endian, expected,
case::normal(fxhashmap!{0x11u8 => 0xAABBu16, 0x23u8 => 0xCCDDu16}, Endian::Little, vec![0x11, 0xBB, 0xAA, 0x23, 0xDD, 0xCC]),
case::normal(fxhashmap!{0x11u8 => 0xAABBu16, 0x23u8 => 0xCCDDu16}, Endian::Little, vec![0x23, 0xDD, 0xCC, 0x11, 0xBB, 0xAA]),
)]
fn test_hashmap_write(input: FxHashMap<u8, u16>, endian: Endian, expected: Vec<u8>) {
let mut writer = Writer::new(Cursor::new(vec![]));
Expand Down
4 changes: 2 additions & 2 deletions src/impls/hashset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ mod tests {
}

#[rstest(input, endian, expected,
case::normal(vec![0xAABB, 0xCCDD].into_iter().collect(), Endian::Little, vec![0xDD, 0xCC, 0xBB, 0xAA]),
case::normal(vec![0xAABB, 0xCCDD].into_iter().collect(), Endian::Little, vec![0xBB, 0xAA, 0xDD, 0xCC]),
)]
fn test_hashset_write(input: FxHashSet<u16>, endian: Endian, expected: Vec<u8>) {
let mut writer = Writer::new(Cursor::new(vec![]));
Expand All @@ -290,7 +290,7 @@ mod tests {
#[cfg(feature = "bits")]
#[rstest(input, endian, bit_size, limit, expected, expected_rest_bits, expected_rest_bytes, expected_write,
case::normal_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), 2.into(), vec![0xBBAA, 0xDDCC].into_iter().collect(), bits![u8, Msb0;], &[], vec![0xCC, 0xDD, 0xAA, 0xBB]),
case::normal_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), 2.into(), vec![0xAABB, 0xCCDD].into_iter().collect(), bits![u8, Msb0;], &[], vec![0xCC, 0xDD, 0xAA, 0xBB]),
case::normal_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), 2.into(), vec![0xAABB, 0xCCDD].into_iter().collect(), bits![u8, Msb0;], &[], vec![0xAA, 0xBB, 0xCC, 0xDD]),
case::predicate_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), (|v: &u16| *v == 0xBBAA).into(), vec![0xBBAA].into_iter().collect(), bits![u8, Msb0;], &[0xcc, 0xdd], vec![0xAA, 0xBB]),
case::predicate_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), (|v: &u16| *v == 0xAABB).into(), vec![0xAABB].into_iter().collect(), bits![u8, Msb0;], &[0xcc, 0xdd], vec![0xAA, 0xBB]),
case::bytes_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), BitSize(16).into(), vec![0xBBAA].into_iter().collect(), bits![u8, Msb0;], &[0xcc, 0xdd], vec![0xAA, 0xBB]),
Expand Down

0 comments on commit 2d615e4

Please sign in to comment.