lrzcc_wire/
common.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::borrow::Borrow;
use std::fmt::Display;

pub fn display_option<T: Display>(option: &Option<T>) -> String {
    match option {
        Some(value) => value.to_string(),
        None => "".to_string(),
    }
}

#[allow(dead_code)]
pub fn is_true(b: impl Borrow<bool>) -> bool {
    *b.borrow()
}

pub fn is_false(b: impl Borrow<bool>) -> bool {
    !b.borrow()
}