f1r3fly-shared 0.1.0

Shared utilities and common functionality for F1r3fly blockchain components
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
pub fn wrap_with_braces(expr: String) -> String {
    match expr.parse::<i32>() {
        Ok(_) => expr.clone(),

        Err(_) => {
            if expr.starts_with('(') && expr.ends_with(')') {
                expr.clone()
            } else {
                format!("({})", expr)
            }
        }
    }
}