Skip to content

Commit 4a19876

Browse files
committed
refactor
1 parent 4ac82d3 commit 4a19876

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/common.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ impl Source {
127127
while i < 16 {
128128
buf[i] = self.read_u8(offset + j)?;
129129
i += 1;
130-
if j > 0 {
131-
j -= 1;
132-
}
130+
j = j.saturating_sub(1);
133131
}
134132
let result = Ipv6Addr::from(buf);
135133
Ok(result)

0 commit comments

Comments
 (0)