dragonball: update for review

update for review

Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
This commit is contained in:
Quanwei Zhou
2022-07-11 07:57:40 +08:00
committed by quanwei.zqw
parent 274598ae56
commit 3c989521b1
7 changed files with 29 additions and 32 deletions

View File

@@ -64,7 +64,7 @@ impl TryFrom<AddressMessage> for Address {
}
}
pub(crate) fn parse_ip(ip: &Vec<u8>, family: u8) -> Result<IpAddr> {
pub(crate) fn parse_ip(ip: &[u8], family: u8) -> Result<IpAddr> {
let support_len = if family as u16 == AF_INET { 4 } else { 16 };
if ip.len() != support_len {
return Err(anyhow!(