use std::sync::Mutex;
use once_cell::sync::Lazy;
static SET: Lazy<Mutex<SymbolSet>> = Lazy::new(|| Mutex::new(UNICODE));
pub fn current() -> SymbolSet {
SET.lock().expect("symbol set poisoned").clone()
}
pub fn set(new: SymbolSet) {
*SET.lock().expect("symbol set poisoned") = new;
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SymbolSet {
pub pointer: char,
pub arrow: char,
pub completed: char,
pub middle_dot: char,
pub cross: char,
pub box_top_right: char,
pub box_top_left: char,
pub box_bottom_right: char,
pub box_bottom_left: char,
pub box_horizontal: char,
pub box_vertical: char,
}
pub const UNICODE: SymbolSet = SymbolSet {
pointer: '❯',
arrow: '›',
completed: '✔',
middle_dot: '·',
cross: '✖',
box_top_right: '┐',
box_top_left: '┌',
box_bottom_right: '┘',
box_bottom_left: '└',
box_horizontal: '─',
box_vertical: '│',
};
pub const ASCII: SymbolSet = SymbolSet {
pointer: '>',
arrow: '>',
completed: '?',
middle_dot: '~',
cross: 'x',
box_top_right: '.',
box_top_left: '.',
box_bottom_right: '\'',
box_bottom_left: '\'',
box_horizontal: '-',
box_vertical: '|',
};