identifiers-validation: Don't validate key ID version with feature = "compat"
This commit is contained in:
parent
d746244241
commit
85fc0b39da
@ -6,11 +6,13 @@ pub fn validate(s: &str) -> Result<NonZeroU8, Error> {
|
|||||||
let colon_idx = NonZeroU8::new(s.find(':').ok_or(Error::MissingDelimiter)? as u8)
|
let colon_idx = NonZeroU8::new(s.find(':').ok_or(Error::MissingDelimiter)? as u8)
|
||||||
.ok_or(Error::InvalidKeyAlgorithm)?;
|
.ok_or(Error::InvalidKeyAlgorithm)?;
|
||||||
|
|
||||||
|
#[cfg(not(feature = "compat"))]
|
||||||
validate_version(&s[colon_idx.get() as usize + 1..])?;
|
validate_version(&s[colon_idx.get() as usize + 1..])?;
|
||||||
|
|
||||||
Ok(colon_idx)
|
Ok(colon_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "compat"))]
|
||||||
fn validate_version(version: &str) -> Result<(), Error> {
|
fn validate_version(version: &str) -> Result<(), Error> {
|
||||||
if version.is_empty() {
|
if version.is_empty() {
|
||||||
return Err(Error::EmptyRoomVersionId);
|
return Err(Error::EmptyRoomVersionId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user