lrzcc_wire/
common.rs

1use std::borrow::Borrow;
2use std::fmt::Display;
3
4pub fn display_option<T: Display>(option: &Option<T>) -> String {
5    match option {
6        Some(value) => value.to_string(),
7        None => "".to_string(),
8    }
9}
10
11#[allow(dead_code)]
12pub fn is_true(b: impl Borrow<bool>) -> bool {
13    *b.borrow()
14}
15
16pub fn is_false(b: impl Borrow<bool>) -> bool {
17    !b.borrow()
18}