git.delta.rocks / unique-network / refs/commits / e6b5895b5e8e

difftreelog

fix property key chars check

Daniel Shiposha2022-05-17parent: #5a6e190.patch.diff
in: master

1 file changed

modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
700 }700 }
701701
702 for byte in key.as_slice().iter() {702 for byte in key.as_slice().iter() {
703 let byte = *byte;
704
703 match char::from_u32(*byte as u32) {705 if !byte.is_ascii_alphanumeric()
704 Some(ch)706 && byte != b'_'
705 if ch.is_ascii_alphanumeric()707 && byte != b'-' {
706 || ch == '_'
707 || ch == '-' => { /* OK */ },
708 _ => return Err(PropertiesError::InvalidCharacterInPropertyKey)708 return Err(PropertiesError::InvalidCharacterInPropertyKey)
709 }709 }
710 }710 }
711711