Skip to content

Commit eb86296

Browse files
committed
f revert useless diff to DRY code back up
1 parent 4583457 commit eb86296

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lightning/src/onion_message/dns_resolution.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ pub struct HumanReadableName {
201201
domain_len: u8,
202202
}
203203

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-
209204
impl HumanReadableName {
210205
/// Constructs a new [`HumanReadableName`] from the `user` and `domain` parts. See the
211206
/// struct-level documentation for more on the requirements on each.
@@ -220,7 +215,7 @@ impl HumanReadableName {
220215
if user.is_empty() || domain.is_empty() {
221216
return Err(());
222217
}
223-
if !str_chars_allowed(&user) || !str_chars_allowed(&domain) {
218+
if !Hostname::str_is_valid_hostname(&user) || !Hostname::str_is_valid_hostname(&domain) {
224219
return Err(());
225220
}
226221
let mut contents = [0; 255 - REQUIRED_EXTRA_LEN];

0 commit comments

Comments
 (0)