aboutsummaryrefslogtreecommitdiffstats
path: root/src/arg.rs
blob: d1d62d9929880851fc9fa62c9169d19545e5821c (plain)
1
2
3
4
5
6
7
8
9
use regex::{self, Regex};


/// Check if `s` is a numeric ID.
pub fn is_suggestion_id(s: &str) -> Result<bool, regex::Error> {
    let re = Regex::new(r"^\d+$")?;

    Ok(re.is_match(s))
}