Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ restriction = { level = "warn", priority = -2 }
arithmetic_side_effects = "allow" # TODO: consider
as_conversions = "allow" # TODO: tricky
borrow_as_ptr = "allow"
cast_lossless = "allow" # TODO: easy fix
cast_possible_truncation = "allow" # TODO: consider
cast_precision_loss = "allow" # TODO: consider
checked_conversions = "allow"
Expand Down
2 changes: 1 addition & 1 deletion src/common/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl CachedDate {
.subsec_nanos();

self.render(now);
self.next_update = now + Duration::new(1, 0) - Duration::from_nanos(nanos as u64);
self.next_update = now + Duration::new(1, 0) - Duration::from_nanos(u64::from(nanos));
}

fn render(&mut self, now: SystemTime) {
Expand Down
2 changes: 1 addition & 1 deletion src/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn from_digits(bytes: &[u8]) -> Option<u64> {
match b {
b'0'..=b'9' => {
result = result.checked_mul(RADIX)?;
result = result.checked_add((b - b'0') as u64)?;
result = result.checked_add(u64::from(b - b'0'))?;
}
_ => {
// not a DIGIT, get outta here!
Expand Down
12 changes: 6 additions & 6 deletions src/proto/h1/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,15 @@ impl ChunkedState {
match byte!(rdr, cx) {
b @ b'0'..=b'9' => {
*size = or_overflow!(size.checked_mul(radix));
*size = or_overflow!(size.checked_add((b - b'0') as u64));
*size = or_overflow!(size.checked_add(u64::from(b - b'0')));
}
b @ b'a'..=b'f' => {
*size = or_overflow!(size.checked_mul(radix));
*size = or_overflow!(size.checked_add((b + 10 - b'a') as u64));
*size = or_overflow!(size.checked_add(u64::from(b + 10 - b'a')));
}
b @ b'A'..=b'F' => {
*size = or_overflow!(size.checked_mul(radix));
*size = or_overflow!(size.checked_add((b + 10 - b'A') as u64));
*size = or_overflow!(size.checked_add(u64::from(b + 10 - b'A')));
}
_ => {
return Poll::Ready(Err(io::Error::new(
Expand All @@ -389,15 +389,15 @@ impl ChunkedState {
match byte!(rdr, cx) {
b @ b'0'..=b'9' => {
*size = or_overflow!(size.checked_mul(radix));
*size = or_overflow!(size.checked_add((b - b'0') as u64));
*size = or_overflow!(size.checked_add(u64::from(b - b'0')));
}
b @ b'a'..=b'f' => {
*size = or_overflow!(size.checked_mul(radix));
*size = or_overflow!(size.checked_add((b + 10 - b'a') as u64));
*size = or_overflow!(size.checked_add(u64::from(b + 10 - b'a')));
}
b @ b'A'..=b'F' => {
*size = or_overflow!(size.checked_mul(radix));
*size = or_overflow!(size.checked_add((b + 10 - b'A') as u64));
*size = or_overflow!(size.checked_add(u64::from(b + 10 - b'A')));
}
b'\t' | b' ' => return Poll::Ready(Ok(ChunkedState::SizeLws)),
b';' => return Poll::Ready(Ok(ChunkedState::Extension)),
Expand Down
2 changes: 1 addition & 1 deletion src/proto/h2/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl Bdp {
fn seconds(dur: Duration) -> f64 {
const NANOS_PER_SEC: f64 = 1_000_000_000.0;
let secs = dur.as_secs() as f64;
secs + (dur.subsec_nanos() as f64) / NANOS_PER_SEC
secs + (f64::from(dur.subsec_nanos())) / NANOS_PER_SEC
}

// ===== impl KeepAlive =====
Expand Down
Loading