Skip to content

Provide a Display implementation for CharacterClass #11

Description

@Cldfire

While writing https://github.com/Cldfire/password-rules-checker I came across a place where it would be nice to have a way to pretty-print a CharacterClass:

let possibly_shortened_allows = remove_unecessary_allows(&quirk_parsed);

if quirk_parsed.allowed != possibly_shortened_allows {
    // TODO: pretty print the suggestion
    println!(
        "{}: the `allowed` property for this rule can be shortened to: {:?}",
        site, possibly_shortened_allows
    );
}

I'd like to print allowed: upper, [%^*]; instead of [Upper, Custom(['%', '^', '*'])]. A Display impl for CharacterClass would make that simple.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions