Skip to content

Commit 596aa78

Browse files
committed
chore: Merge branch 'release/0.11.0'
2 parents ded7669 + 876d21d commit 596aa78

28 files changed

+529
-171
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
git tag --sort=committerdate | grep -E "^[0-9]+\.[0-9]+\.[0-9]$" | tail -n 1
1+
git tag --sort=taggerdate | grep -E "^[0-9]+\.[0-9]+\.[0-9]$" | tail -n 1

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
- id: conventional-pre-commit
1111
stages: [commit-msg]
1212
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: v5.0.0
13+
rev: v6.0.0
1414
hooks:
1515
- id: check-added-large-files
1616
stages: [pre-commit]

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [0.11.0](https://github.com/midi2-dev/bl-midi2-rs/compare/0.10.0..0.11.0) - 2025-08-21
4+
5+
### ✨ Features
6+
7+
- *(sysex)* Splicing payload data - ([3ce414c](https://github.com/midi2-dev/bl-midi2-rs/commit/3ce414c4576f82497518f5a8c7396126b628ea6d))
8+
9+
### 🐛 Fixes
10+
11+
- Ci | release start determines incorrect previous version - ([62499f5](https://github.com/midi2-dev/bl-midi2-rs/commit/62499f51907fb67e234946b964528a38a33800df))
12+
- Include trailing reserved bytes - ([6e224a9](https://github.com/midi2-dev/bl-midi2-rs/commit/6e224a92c9aab5595aa12a373b2996a831f33bdd))
13+
- Further clippy warnings - ([8bbee8b](https://github.com/midi2-dev/bl-midi2-rs/commit/8bbee8ba8932b13aa018befd98e88a6f8e0c68d1))
14+
- Readme file link - ([eaa0c41](https://github.com/midi2-dev/bl-midi2-rs/commit/eaa0c41e24c8e1f70a8a1168d93705b14e722907))
15+
316
## [0.10.0](https://github.com/midi2-dev/bl-midi2-rs/compare/0.9.0..0.10.0) - 2025-07-27
417

518
### 🐛 Fixes

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ for more details on the data protocol standard.
1818
> Expect breaking changes and bugs, and please report any issues you encounter.
1919
2020
We would welcome contributions!
21-
Please refer to the [CONTRIBUTOR.md](CONTRIBUTOR.md)
21+
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md)
2222

2323
## Strongly Typed Message Wrappers
2424

@@ -163,7 +163,7 @@ You'll want to setup midi2 without default features to compile
163163
without the `std` feature.
164164

165165
```toml
166-
midi2 = { version = "0.10.0", default-features = false, features = ["channel-voice2", "sysex7"], }
166+
midi2 = { version = "0.11.0", default-features = false, features = ["channel-voice2", "sysex7"], }
167167
```
168168

169169
### Generic Representation

examples/handling_messages/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn handle_message(buffer: &[u32]) {
2929
);
3030
}
3131
Err(e) => {
32-
println!("Error parsing ump buffer: {:?}", e);
32+
println!("Error parsing ump buffer: {e:?}");
3333
}
3434
_ => {}
3535
}

examples/no_std_dynamic_message_generator/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,6 @@ impl Generator {
113113
fn main() {
114114
let mut generator = Generator::new();
115115
for message in generator.generate().unwrap() {
116-
std::println!("{:?}", message);
116+
std::println!("{message:?}");
117117
}
118118
}

fuzz/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ doc = false
3838
bench = false
3939

4040
[[bin]]
41-
name = "generic_sysex_inserting_payloads"
42-
path = "./fuzz_targets/generic_sysex_inserting_payloads.rs"
41+
name = "generic_sysex_splicing_payloads"
42+
path = "./fuzz_targets/generic_sysex_splicing_payloads.rs"
4343
test = false
4444
doc = false
4545
bench = false

fuzz/fuzz_targets/generic_sysex_inserting_payloads.rs renamed to fuzz/fuzz_targets/generic_sysex_splicing_payloads.rs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ impl IntoByte<u8> for u8 {
5959
}
6060
}
6161

62-
fn test_case<B, M>(data: &InputData, mut message: M, index: usize)
62+
fn test_case<B, M, R>(data: &InputData, mut message: M, range: R)
6363
where
6464
B: midi2::buffer::Buffer + midi2::buffer::BufferTryResize + midi2::buffer::BufferMut,
6565
M: midi2::Sysex<B>,
6666
<M as Sysex<B>>::Byte: Eq + core::fmt::Debug,
6767
u8: IntoByte<<M as Sysex<B>>::Byte>,
68+
R: core::ops::RangeBounds<usize> + Clone,
6869
{
6970
let Ok(()) = message.try_set_payload(data.initial_data.iter().map(u8::byte)) else {
7071
return;
@@ -78,14 +79,16 @@ where
7879
);
7980
}
8081

81-
let Ok(()) = message.try_insert_payload(data.data_to_insert.iter().map(u8::byte), index) else {
82+
let Ok(()) =
83+
message.try_splice_payload(data.data_to_insert.iter().map(u8::byte), range.clone())
84+
else {
8285
return;
8386
};
8487

8588
let actual = message.payload().collect::<Vec<_>>();
8689
let expected = {
8790
let mut ret = data.initial_data.clone();
88-
ret.splice(index..index, data.data_to_insert.clone());
91+
ret.splice(range, data.data_to_insert.clone());
8992
ret.iter().map(u8::byte).collect::<Vec<_>>()
9093
};
9194
assert_eq!(actual, expected);
@@ -94,33 +97,41 @@ where
9497
fuzz_target!(|data: InputData| {
9598
let mut rng = rand::rngs::StdRng::seed_from_u64(data.seed);
9699
let fized_size_buffer_size = rng.random_range(4..MAX_BUFFER_SIZE);
97-
let index = if data.initial_data.is_empty() {
98-
0
99-
} else {
100-
rng.random_range(0..data.initial_data.len())
100+
let range = {
101+
if data.initial_data.is_empty() {
102+
0..0
103+
} else {
104+
let lower = rng.random_range(0..data.initial_data.len());
105+
if lower == data.initial_data.len() {
106+
lower..lower
107+
} else {
108+
let upper = rng.random_range(lower..data.initial_data.len());
109+
lower..upper
110+
}
111+
}
101112
};
102113
test_case(
103114
&data,
104115
midi2::sysex8::Sysex8::<FixedSizeBuffer<u32>>::try_new_with_buffer(
105116
FixedSizeBuffer::<u32>::new(fized_size_buffer_size),
106117
)
107118
.unwrap(),
108-
index,
119+
range.clone(),
109120
);
110121
test_case(
111122
&data,
112123
midi2::sysex7::Sysex7::<FixedSizeBuffer<u32>>::try_new_with_buffer(
113124
FixedSizeBuffer::<u32>::new(fized_size_buffer_size),
114125
)
115126
.unwrap(),
116-
index,
127+
range.clone(),
117128
);
118129
test_case(
119130
&data,
120131
midi2::sysex7::Sysex7::<FixedSizeBuffer<u8>>::try_new_with_buffer(
121132
FixedSizeBuffer::<u8>::new(fized_size_buffer_size),
122133
)
123134
.unwrap(),
124-
index,
135+
range.clone(),
125136
);
126137
});

midi2/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "midi2"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
description = "Ergonomic, versatile, strong types wrapping MIDI 2.0 message data."
55
edition = "2021"
66
readme = "README.md"
@@ -17,7 +17,7 @@ manual_div_ceil = "allow"
1717
[dependencies]
1818
derive_more = { version = "2.0.1", features = ["from"], default-features = false }
1919
fixed = "1.28.0"
20-
midi2_proc = { version = "0.10.0", path = "../midi2_proc" }
20+
midi2_proc = { version = "0.11.0", path = "../midi2_proc" }
2121
ux = "0.1.6"
2222

2323
[dev-dependencies]

midi2/src/channel_voice2/per_note_management.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(crate) const STATUS: u8 = 0b1111;
99
/// MIDI 2.0 Channel Voice Per Note Management Message
1010
///
1111
/// See the [module docs](crate::channel_voice2) for more info.
12-
#[midi2_proc::generate_message(Via(crate::channel_voice2::ChannelVoice2), FixedSize, MinSizeUmp(1))]
12+
#[midi2_proc::generate_message(Via(crate::channel_voice2::ChannelVoice2), FixedSize, MinSizeUmp(2))]
1313
struct PerNoteManagement {
1414
#[property(common_properties::UmpMessageTypeProperty<UMP_MESSAGE_TYPE>)]
1515
ump_type: (),
@@ -49,7 +49,7 @@ mod tests {
4949
#[test]
5050
fn note_number() {
5151
assert_eq!(
52-
PerNoteManagement::try_from(&[0x4BF9_1C03][..])
52+
PerNoteManagement::try_from(&[0x4BF9_1C03, 0x0][..])
5353
.unwrap()
5454
.note_number(),
5555
u7::new(0x1C),
@@ -58,14 +58,14 @@ mod tests {
5858

5959
#[test]
6060
fn detach() {
61-
assert!(PerNoteManagement::try_from(&[0x4BF9_1C03][..])
61+
assert!(PerNoteManagement::try_from(&[0x4BF9_1C03, 0x0][..])
6262
.unwrap()
6363
.detach(),);
6464
}
6565

6666
#[test]
6767
fn reset() {
68-
assert!(PerNoteManagement::try_from(&[0x4BF9_1C03][..])
68+
assert!(PerNoteManagement::try_from(&[0x4BF9_1C03, 0x0][..])
6969
.unwrap()
7070
.reset(),);
7171
}

0 commit comments

Comments
 (0)