generalize EdnItem.

maybe should rename it to Atom? ~90 instances of it
This commit is contained in:
🪞👃🪞 2025-01-17 19:47:35 +01:00
parent 1b9da07280
commit 143cd24e09
20 changed files with 314 additions and 286 deletions

View file

@ -210,7 +210,7 @@ edn_command!(MidiEditCommand: |state: MidiEditor| {
impl MidiEditCommand {
fn from_tui_event (state: &MidiEditor, input: &impl EdnInput) -> Usually<Option<Self>> {
use EdnItem::*;
let edns = EdnItem::<&str>::read_all(KEYS_EDIT)?;
let edns = EdnItem::read_all(KEYS_EDIT)?;
for item in edns.iter() {
if let Exp(e) = item {
match e.as_slice() {

View file

@ -192,7 +192,7 @@ content!(TuiOut: |self: ClipLength| {
impl PoolCommand {
pub fn from_tui_event (state: &MidiPool, input: &impl EdnInput) -> Usually<Option<Self>> {
use EdnItem::*;
let edns: Vec<EdnItem> = EdnItem::read_all(match state.mode() {
let edns: Vec<EdnItem<_>> = EdnItem::read_all(match state.mode() {
Some(PoolMode::Rename(..)) => KEYS_RENAME,
Some(PoolMode::Length(..)) => KEYS_LENGTH,
Some(PoolMode::Import(..)) | Some(PoolMode::Export(..)) => KEYS_FILE,