Skip to content
Snippets Groups Projects
Commit c94aad29 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

refac docstring of `validate_idty_name`

parent 35cbc18b
No related branches found
No related tags found
1 merge request!265Fix #218 and #158
Pipeline #37141 passed
...@@ -16,12 +16,10 @@ ...@@ -16,12 +16,10 @@
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
/// Rules for valid identity names are defined below /// Checks rules for valid identity names
/// - Bound length to 42 /// - Limit length to 42
/// - accept only ascii alphanumeric or - or _ /// - Accept only ascii alphanumeric or `-` or `_`
pub fn validate_idty_name(idty_name: &[u8]) -> bool { pub fn validate_idty_name(idty_name: &[u8]) -> bool {
// length smaller than 42
// all characters are alphanumeric or - or _
idty_name.len() >= 3 idty_name.len() >= 3
&& idty_name.len() <= 42 && idty_name.len() <= 42
&& idty_name && idty_name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment