Replace match with if-let
Clippy didn't like this.
This commit is contained in:
parent
fba2c47614
commit
5db07090ca
2 changed files with 9 additions and 14 deletions
|
@ -1643,16 +1643,14 @@ impl<P: ClapPlugin> Wrapper<P> {
|
|||
{
|
||||
let event = &*(event as *const clap_event_midi_sysex);
|
||||
|
||||
// `NoteEvent::from_midi` prints some tracing if parsing fails, which is not
|
||||
// necessarily an error
|
||||
assert!(!event.buffer.is_null());
|
||||
let sysex_buffer = std::slice::from_raw_parts(event.buffer, event.size as usize);
|
||||
match NoteEvent::from_midi(raw_event.time - current_sample_idx as u32, sysex_buffer)
|
||||
if let Ok(note_event) =
|
||||
NoteEvent::from_midi(raw_event.time - current_sample_idx as u32, sysex_buffer)
|
||||
{
|
||||
Ok(note_event) => {
|
||||
input_events.push_back(note_event);
|
||||
}
|
||||
// `NoteEvent::from_midi` prints some tracing if parsing fails, which is not
|
||||
// necessarily an error
|
||||
Err(_) => (),
|
||||
input_events.push_back(note_event);
|
||||
};
|
||||
}
|
||||
_ => {
|
||||
|
|
|
@ -1228,16 +1228,13 @@ impl<P: Vst3Plugin> IAudioProcessor for Wrapper<P> {
|
|||
// 0 = kMidiSysEx
|
||||
let event = event.event.data;
|
||||
|
||||
// `NoteEvent::from_midi` prints some tracing if parsing fails, which is
|
||||
// not necessarily an error
|
||||
assert!(!event.bytes.is_null());
|
||||
let sysex_buffer =
|
||||
std::slice::from_raw_parts(event.bytes, event.size as usize);
|
||||
match NoteEvent::from_midi(timing, sysex_buffer) {
|
||||
Ok(note_event) => {
|
||||
process_events.push(ProcessEvent::NoteEvent(note_event));
|
||||
}
|
||||
// `NoteEvent::from_midi` prints some tracing if parsing fails,
|
||||
// which is not necessarily an error
|
||||
Err(_) => (),
|
||||
if let Ok(note_event) = NoteEvent::from_midi(timing, sysex_buffer) {
|
||||
process_events.push(ProcessEvent::NoteEvent(note_event));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue