Add basic README

finchie
Oct 8, 2023, 4:05 AM
FTE4U5EI6RSY42RMW5L3ZHGBNXVMHTQKOXPF3EVLH7PAORTD5VGAC

Dependencies

Change contents

  • file addition: README.md (----------)
    [2.1]
    # span_validator
    Simple validation with error reporting, inspired by [validator](https://github.com/Keats/validator). Provide users with targeted, actionable error messages.
    ## Why not validator?
    I'd love to see this functionality [become a part of validator](https://github.com/Keats/validator/pull/272). Until then, unless you specifically need span-based validation, just use validator. This crate only exists to provide better error messages than possible with just validator.
    ## Example
    ```rust
    use span_validator::email::{Error, ErrorSpan, validate_email};
    // invalid"@example.com
    // ^
    assert_eq!(
    validate_email(r#"invalid"@example.com"#),
    Err(ErrorSpan { error_type: Error::InvalidUserCharacter, span: 7..7 })
    );
    ```