update for deprecating u8::MAX and usize::max_value()

This commit is contained in:
John
2021-10-23 16:06:39 +08:00
committed by ty
parent 0be46acf0f
commit 949310edaa
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ impl ParsingRules {
}
fn compile_regex(name: &'static str, regex_rules: Vec<String>) -> io::Result<RegexSet> {
const REGEX_SIZE_LIMIT: usize = usize::max_value();
const REGEX_SIZE_LIMIT: usize = usize::MAX;
RegexSetBuilder::new(regex_rules)
.size_limit(REGEX_SIZE_LIMIT)
.unicode(false)
+1 -2
View File
@@ -9,7 +9,6 @@ use std::{
net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs},
slice,
str::FromStr,
u8,
vec,
};
@@ -422,7 +421,7 @@ fn write_ipv6_address<B: BufMut>(addr: &SocketAddrV6, buf: &mut B) {
}
fn write_domain_name_address<B: BufMut>(dnaddr: &str, port: u16, buf: &mut B) {
assert!(dnaddr.len() <= u8::max_value() as usize);
assert!(dnaddr.len() <= u8::MAX as usize);
buf.put_u8(consts::SOCKS5_ADDR_TYPE_DOMAIN_NAME);
assert!(