tune-cli 0.28.0

Explore musical tunings and create synthesizer tuning files for microtonal scales.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::fmt::Debug;

pub trait ResultExt<T, E> {
    fn handle_error<F>(self, context: &str) -> Result<T, F>
    where
        E: Debug,
        F: From<String>;
}

impl<T, E> ResultExt<T, E> for Result<T, E> {
    fn handle_error<F>(self, context: &str) -> Result<T, F>
    where
        E: Debug,
        F: From<String>,
    {
        self.map_err(|err| F::from(format!("{context}\n{err:#?}")))
    }
}