wip(p66,e16)

This commit is contained in:
🪞👃🪞 2024-11-21 16:41:47 +01:00
parent e768790658
commit faf7576ad8
2 changed files with 6 additions and 5 deletions

View file

@ -153,7 +153,7 @@ impl<T: PhrasesControl> Command<T> for PhraseLengthCommand {
fn execute (self, state: &mut T) -> Perhaps<Self> {
use PhraseLengthFocus::*;
use PhraseLengthCommand::*;
let mode = state.phrases_mode_mut();
let mut mode = state.phrases_mode_mut().clone();
if let Some(PhrasesMode::Length(
phrase,
ref mut length,
@ -180,10 +180,11 @@ impl<T: PhrasesControl> Command<T> for PhraseLengthCommand {
Tick => { *length = length.saturating_sub(1) },
},
Self::Set(length) => {
let mut phrase = state.phrases()[*phrase].write().unwrap();
let mut phrase = state.phrases()[phrase].write().unwrap();
let old_length = phrase.length;
phrase.length = length;
*mode = None;
std::mem::drop(phrase);
*state.phrases_mode_mut() = None;
return Ok(Some(Self::Set(old_length)))
},
_ => unreachable!()