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
9 changes: 3 additions & 6 deletions crates/wasi-http/src/p3/host/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,7 @@ impl HostRequestOptions for WasiHttpCtxView<'_> {
return Ok(None);
};
let ns = connect_timeout.as_nanos();
let ns = ns
.try_into()
let ns = Duration::try_from(ns)
.context("connect timeout duration nanoseconds do not fit in u64")?;
Ok(Some(ns))
}
Expand All @@ -540,8 +539,7 @@ impl HostRequestOptions for WasiHttpCtxView<'_> {
return Ok(None);
};
let ns = first_byte_timeout.as_nanos();
let ns = ns
.try_into()
let ns = Duration::try_from(ns)
.context("first byte timeout duration nanoseconds do not fit in u64")?;
Ok(Some(ns))
}
Expand All @@ -566,8 +564,7 @@ impl HostRequestOptions for WasiHttpCtxView<'_> {
return Ok(None);
};
let ns = between_bytes_timeout.as_nanos();
let ns = ns
.try_into()
let ns = Duration::try_from(ns)
.context("between bytes timeout duration nanoseconds do not fit in u64")?;
Ok(Some(ns))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,7 @@ impl SlabConstraints {
let guard_bytes = HostAlignedByteCount::new_rounded_up_u64(tunables.memory_guard_size)
.context("guard region is too large")?;

let num_slots = limits
.total_memories
.try_into()
.context("too many memories")?;
let num_slots = usize::try_from(limits.total_memories).context("too many memories")?;

let constraints = SlabConstraints {
max_memory_bytes,
Expand Down