fn check_length(actual: usize, expected_n: Option<i64>) -> bool
Check if length matches expected n (None = no restriction).