ruma_identifiers_validation/
room_id_or_alias_id.rs

1
2
3
4
5
6
7
8
9
use crate::Error;

pub fn validate(s: &str) -> Result<(), Error> {
    match s.as_bytes().first() {
        Some(b'#') => crate::room_alias_id::validate(s),
        Some(b'!') => crate::room_id::validate(s),
        _ => Err(Error::MissingLeadingSigil),
    }
}