use once_cell::sync::Lazy;
use std::collections::HashSet;
pub static ALPHA: Lazy<HashSet<char>> =
Lazy::new(|| ('a'..='z').chain('A'..='Z').collect());
pub static DIGIT: Lazy<HashSet<char>> = Lazy::new(|| ('0'..='9').collect());
pub static HEXDIG: Lazy<HashSet<char>> = Lazy::new(|| {
DIGIT.iter().copied().chain('A'..='F').chain('a'..='f').collect()
});
pub static UNRESERVED: Lazy<HashSet<char>> = Lazy::new(|| {
ALPHA
.iter()
.chain(DIGIT.iter())
.chain(['-', '.', '_', '~'].iter())
.copied()
.collect()
});
pub static SUB_DELIMS: Lazy<HashSet<char>> = Lazy::new(|| {
['!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=']
.iter()
.copied()
.collect()
});
pub static SCHEME_NOT_FIRST: Lazy<HashSet<char>> = Lazy::new(|| {
ALPHA
.iter()
.chain(DIGIT.iter())
.chain(['+', '-', '.'].iter())
.copied()
.collect()
});
pub static PCHAR_NOT_PCT_ENCODED: Lazy<HashSet<char>> = Lazy::new(|| {
UNRESERVED
.iter()
.chain(SUB_DELIMS.iter())
.chain([':', '@'].iter())
.copied()
.collect()
});
pub static QUERY_OR_FRAGMENT_NOT_PCT_ENCODED: Lazy<HashSet<char>> =
Lazy::new(|| {
PCHAR_NOT_PCT_ENCODED.iter().chain(['/', '?'].iter()).copied().collect()
});
pub static QUERY_NOT_PCT_ENCODED_WITHOUT_PLUS: Lazy<HashSet<char>> =
Lazy::new(|| {
UNRESERVED
.iter()
.chain(
[
'!', '$', '&', '\'', '(', ')', '*', ',', ';', '=', ':',
'@', '/', '?',
]
.iter(),
)
.copied()
.collect()
});
pub static USER_INFO_NOT_PCT_ENCODED: Lazy<HashSet<char>> = Lazy::new(|| {
UNRESERVED
.iter()
.chain(SUB_DELIMS.iter())
.chain([':'].iter())
.copied()
.collect()
});
pub static REG_NAME_NOT_PCT_ENCODED: Lazy<HashSet<char>> =
Lazy::new(|| UNRESERVED.iter().chain(SUB_DELIMS.iter()).copied().collect());
pub static IPV_FUTURE_LAST_PART: Lazy<HashSet<char>> = Lazy::new(|| {
UNRESERVED
.iter()
.chain(SUB_DELIMS.iter())
.chain([':'].iter())
.copied()
.collect()
});