Check errors in add_subscription_dialog

This commit is contained in:
ranfdev
2023-10-24 12:35:57 +02:00
parent d2af2712da
commit a88308d67a
2 changed files with 28 additions and 2 deletions

View File

@ -14,7 +14,7 @@ fn emoji_map() -> &'static HashMap<String, String> {
})
}
fn validate_topic(topic: &str) -> Result<&str, Error> {
pub fn validate_topic(topic: &str) -> Result<&str, Error> {
let re = Regex::new(r"^\w+$").unwrap();
if re.is_match(topic) {
Ok(topic)