File tree 1 file changed +1
-6
lines changed
lightning/src/onion_message
1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -201,11 +201,6 @@ pub struct HumanReadableName {
201
201
domain_len : u8 ,
202
202
}
203
203
204
- /// Check if the chars in `s` are allowed to be included in a hostname.
205
- pub ( crate ) fn str_chars_allowed ( s : & str ) -> bool {
206
- s. chars ( ) . all ( |c| c. is_ascii_alphanumeric ( ) || c == '.' || c == '_' || c == '-' )
207
- }
208
-
209
204
impl HumanReadableName {
210
205
/// Constructs a new [`HumanReadableName`] from the `user` and `domain` parts. See the
211
206
/// struct-level documentation for more on the requirements on each.
@@ -220,7 +215,7 @@ impl HumanReadableName {
220
215
if user. is_empty ( ) || domain. is_empty ( ) {
221
216
return Err ( ( ) ) ;
222
217
}
223
- if !str_chars_allowed ( & user) || !str_chars_allowed ( & domain) {
218
+ if !Hostname :: str_is_valid_hostname ( & user) || !Hostname :: str_is_valid_hostname ( & domain) {
224
219
return Err ( ( ) ) ;
225
220
}
226
221
let mut contents = [ 0 ; 255 - REQUIRED_EXTRA_LEN ] ;
You can’t perform that action at this time.
0 commit comments