identifiers-validation: Simplify localpart_is_fully_conforming
This commit is contained in:
parent
56cf3ce94c
commit
4b756c5887
@ -28,11 +28,8 @@ pub fn localpart_is_fully_conforming(localpart: &str) -> Result<bool, Error> {
|
||||
// See https://spec.matrix.org/v1.2/appendices/#historical-user-ids
|
||||
#[cfg(not(feature = "compat"))]
|
||||
if !is_fully_conforming && localpart.bytes().any(|b| b < 0x21 || b == b':' || b > 0x7E) {
|
||||
Err(Error::InvalidCharacters)
|
||||
} else {
|
||||
Ok(is_fully_conforming)
|
||||
return Err(Error::InvalidCharacters);
|
||||
}
|
||||
|
||||
#[cfg(feature = "compat")]
|
||||
Ok(is_fully_conforming)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user