From f87a5c14f9df03f40b47ddfb864ea17b8bdd55c3 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Sat, 16 Aug 2025 07:36:07 +0300 Subject: [PATCH] switch to rust 2024 --- Cargo.toml | 2 +- crates/app/app.rs | 2 +- crates/app/app_jack.rs | 2 +- crates/device/src/lv2/lv2_audio.rs | 4 ++-- crates/device/src/sampler/sampler_audio.rs | 4 ++-- crates/device/src/sequencer/seq_audio.rs | 2 +- crates/engine/src/jack.rs | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c9386a0a..5d15805f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -edition = "2021" +edition = "2024" version = "0.2.1" [workspace] diff --git a/crates/app/app.rs b/crates/app/app.rs index 42507a32..2c05610d 100644 --- a/crates/app/app.rs +++ b/crates/app/app.rs @@ -820,7 +820,7 @@ impl App { // autocolor: new clip colors from scene and track color let color = track.color.base.mix(scene.color.base, 0.5); clip.write().unwrap().color = ItemColor::random_near(color, 0.2).into(); - if let Some(ref mut editor) = &mut self.project.editor { + if let Some(editor) = &mut self.project.editor { editor.set_clip(Some(&clip)); } *slot = Some(clip.clone()); diff --git a/crates/app/app_jack.rs b/crates/app/app_jack.rs index 1174b3b1..57f30f5d 100644 --- a/crates/app/app_jack.rs +++ b/crates/app/app_jack.rs @@ -15,7 +15,7 @@ audio!( let mut pitch: Option = None; for port in midi_in.iter() { for event in port.iter() { - if let (_, Ok(LiveEvent::Midi {message: MidiMessage::NoteOn {ref key, ..}, ..})) + if let (_, Ok(LiveEvent::Midi {message: MidiMessage::NoteOn {key, ..}, ..})) = event { pitch = Some(key.clone()); diff --git a/crates/device/src/lv2/lv2_audio.rs b/crates/device/src/lv2/lv2_audio.rs index 6db76358..9f33d9e6 100644 --- a/crates/device/src/lv2/lv2_audio.rs +++ b/crates/device/src/lv2/lv2_audio.rs @@ -8,8 +8,8 @@ audio!(|self: Lv2, _client, scope|{ audio_ins, audio_outs, lv2_features, - ref mut lv2_instance, - ref mut lv2_input_buffer, + lv2_instance, + lv2_input_buffer, .. } = self; let urid = lv2_features.midi_urid(); diff --git a/crates/device/src/sampler/sampler_audio.rs b/crates/device/src/sampler/sampler_audio.rs index ec1c08e8..a3083a4e 100644 --- a/crates/device/src/sampler/sampler_audio.rs +++ b/crates/device/src/sampler/sampler_audio.rs @@ -81,7 +81,7 @@ impl Sampler { /// Write playing voices to output buffer fn populate_output_buffer (&mut self, frames: usize) { - let Sampler { ref mut buffer, voices, output_gain, mixing_mode, .. } = self; + let Sampler { buffer, voices, output_gain, mixing_mode, .. } = self; let channel_count = buffer.len(); match mixing_mode { MixingMode::Summing => voices.write().unwrap().retain_mut(|voice|{ @@ -95,7 +95,7 @@ impl Sampler { /// Write output buffer to output ports. fn write_output_buffer (&mut self, scope: &ProcessScope) { - let Sampler { ref mut audio_outs, buffer, .. } = self; + let Sampler { audio_outs, buffer, .. } = self; for (i, port) in audio_outs.iter_mut().enumerate() { let buffer = &buffer[i]; for (i, value) in port.port_mut().as_mut_slice(scope).iter_mut().enumerate() { diff --git a/crates/device/src/sequencer/seq_audio.rs b/crates/device/src/sequencer/seq_audio.rs index 060d833b..40ae5e22 100644 --- a/crates/device/src/sequencer/seq_audio.rs +++ b/crates/device/src/sequencer/seq_audio.rs @@ -91,7 +91,7 @@ impl Sequencer { return true } // If there's a currently playing clip, output notes from it to buffer: - if let Some(ref clip) = clip { + if let Some(clip) = clip { // Source clip from which the MIDI events will be taken. let clip = clip.read().unwrap(); // Clip with zero length is not processed diff --git a/crates/engine/src/jack.rs b/crates/engine/src/jack.rs index 7e5214aa..9b611752 100644 --- a/crates/engine/src/jack.rs +++ b/crates/engine/src/jack.rs @@ -54,10 +54,10 @@ impl<'j> Jack<'j> { /// Run something with the client. pub fn with_client (&self, op: impl FnOnce(&Client)->T) -> T { match &*self.0.read().unwrap() { - Inert => panic!("jack client not activated"), - Inactive(ref client) => op(client), - Activating => panic!("jack client has not finished activation"), - Active(ref client) => op(client.as_client()), + Inert => panic!("jack client not activated"), + Inactive(client) => op(client), + Activating => panic!("jack client has not finished activation"), + Active(client) => op(client.as_client()), } } }