Refactor: pull the pre-flight validation block out of send() into a standalone validate_send_input() function. send() now starts with a single validate_send_input(&input)? call. Behavior identical; the extraction is purely so unit tests can exercise the validation paths without standing up a fake SMTP server. New tests (9): - validate_accepts_minimal_input (the happy path) - validate_rejects_empty_to - validate_rejects_too_many_recipients (150 > 100 cap) - validate_recipient_cap_boundary_passes (exactly 100 OK) - validate_rejects_oversized_body - validate_rejects_oversized_body_html - validate_rejects_too_many_attachments - validate_rejects_oversized_attachment_encoded (pre-decode bound) - validate_accepts_at_attachment_boundary Test count: 18 -> 27. All passing. |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||