Skip to content

Commit 949310e

Browse files
18ozonyitoo
authored andcommitted
update for deprecating u8::MAX and usize::max_value()
1 parent 0be46ac commit 949310e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

crates/shadowsocks-service/src/acl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl ParsingRules {
195195
}
196196

197197
fn compile_regex(name: &'static str, regex_rules: Vec<String>) -> io::Result<RegexSet> {
198-
const REGEX_SIZE_LIMIT: usize = usize::max_value();
198+
const REGEX_SIZE_LIMIT: usize = usize::MAX;
199199
RegexSetBuilder::new(regex_rules)
200200
.size_limit(REGEX_SIZE_LIMIT)
201201
.unicode(false)

crates/shadowsocks/src/relay/socks5.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use std::{
99
net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs},
1010
slice,
1111
str::FromStr,
12-
u8,
1312
vec,
1413
};
1514

@@ -422,7 +421,7 @@ fn write_ipv6_address<B: BufMut>(addr: &SocketAddrV6, buf: &mut B) {
422421
}
423422

424423
fn write_domain_name_address<B: BufMut>(dnaddr: &str, port: u16, buf: &mut B) {
425-
assert!(dnaddr.len() <= u8::max_value() as usize);
424+
assert!(dnaddr.len() <= u8::MAX as usize);
426425

427426
buf.put_u8(consts::SOCKS5_ADDR_TYPE_DOMAIN_NAME);
428427
assert!(

0 commit comments

Comments
 (0)