pub fn create_theme(opt: &Opt) -> Theme {
    let locations = locations();
    let mut theme = Theme::default();
    if let Some(th) = &opt.theme {
        locations.iter().find(|d| {
            let path = d.join(&format!("{}.toml", th));
            if !path.exists() {
                return false;
            }

            match get_theme(&path) {
                Ok(t) => {
                    theme = t;
                    theme.set_randomization();
                    true
                }
                Err(e) => {
                    error::print_errors(e);
                    false
                }
            }
        });
    }

    theme
}
/// Searches for and returns the specified theme.
Searches for and returns the specified theme.
Searches for and returns the specified theme .
pub fn create_theme(opt: &Opt) -> Theme {
    let locations = locations();
    let mut theme = Theme::default();
    if let Some(th) = &opt.theme {
        locations.iter().find(|d| {
            let path = d.join(&format!("{}.toml", th));
            if !path.exists() {
                return false;
            }
            match get_theme(&path) {
                Ok(t) => {
                    theme = t;
                    theme.set_randomization();
                    true
                }
                Err(e) => {
                    error::print_errors(e);
                    false
                }
            }
        });
    }
    theme
}
pub fn create_theme ( opt : & Opt ) -> Theme { let locations = locations ( ) ; let mut theme = Theme :: default ( ) ; if let Some ( th ) = & opt . theme { locations . iter ( ) . find ( | d | { let path = d . join ( & format ! ( " " th ) ) ; if ! path . exists ( ) { return false ; } match get_theme ( & path ) { Ok ( t ) => { theme = t ; theme . set_randomization ( ) ; true } Err ( e ) => { error :: print_errors ( e ) ; false } } } ) ; } theme }
Searches for and returns the specified theme.
Searches for and returns the specified theme .
opt
&Opt
opt
&Opt