Skip to main content

validate_alignment_precision

Function validate_alignment_precision 

Source
pub fn validate_alignment_precision(spec: &FieldSpec, value: &str) -> bool
Expand description

Validate alignment+precision constraints for string fields Returns false if validation fails (should reject the match)

This validates the constraints described in issue #3 (parse#218):

  • Fill characters should only be in correct positions (left for right-align, right for left-align)
  • Total width (including fill chars) should not exceed specified width when width is specified
  • Content length (after removing fill chars) should not exceed precision