in core/sdk/src/identifier.rs [73:92]
fn validate(&self) -> Result<(), IggyError> {
if self.length == 0 {
return Err(IggyError::InvalidIdentifier);
}
if self.value.is_empty() {
return Err(IggyError::InvalidIdentifier);
}
#[allow(clippy::cast_possible_truncation)]
if self.length != self.value.len() as u8 {
return Err(IggyError::InvalidIdentifier);
}
if self.kind == IdKind::Numeric && self.length != 4 {
return Err(IggyError::InvalidIdentifier);
}
Ok(())
}