dnaka91 / cargo-hatch

Hatch new projects like a chick coming out of its egg
GNU Affero General Public License v3.0
7 stars 1 forks source link

String validation/rust specific string types #1

Closed ModProg closed 2 years ago

ModProg commented 2 years ago
  1. valid_ident
  2. crate-name
  3. sem.ver (I don't have any use for that one, just came to mind)
  4. a verifying pattern (regex?)

Maybe I will look into implementing this myself

dnaka91 commented 2 years ago

Just for confirmation, do you mean to add an optional restriction to the strings? So that when the user is asked to input a value, it'll refuse anything that doesn't match the custom format/pattern?

ModProg commented 2 years ago

Yes, maybe just display "Not allowed character: -", or "Does not match pattern [A-Za-z_][A-Za-z0-9_]*".

dnaka91 commented 2 years ago

Just added support for various string input validators and pushed a new release. They're documented over here.

ModProg commented 2 years ago

Very nice, only nitpick: Name a crate as description for everything in the documentation :D

dnaka91 commented 2 years ago

Ah, he he... Darn copy & paste. Will improve that tomorrow 😅