brendandburns opened PR #6161 from brendandburns:wasi_http_next
to bytecodealliance:main
:
- Follow up for #5929
- Adds better implementation for body writing on client requests.
brendandburns requested wasmtime-core-reviewers for a review on PR #6161.
brendandburns requested pchickey for a review on PR #6161.
brendandburns updated PR #6161.
brendandburns updated PR #6161.
brendandburns requested wasmtime-default-reviewers for a review on PR #6161.
brendandburns updated PR #6161.
brendandburns updated PR #6161.
pchickey submitted PR review.
pchickey submitted PR review.
pchickey created PR review comment:
since Response is defined above, I would move this function up there. A more idiomatic way to write it is, right under the definition of
struct Response
,impl Response { fn header(&self, name: &str) -> Option<&String> { self.headers.iter().find_map(|(k, v)| if k == name { Some(v) } else { None } ) }
pchickey created PR review comment:
This is going to break as soon as we run more than one test in a process, which I hope we will do soon. I'll work on the structural changes to the test suite to work that out soon, but its ok for now
brendandburns updated PR #6161.
pchickey submitted PR review.
pchickey submitted PR review.
pchickey created PR review comment:
Tests are the one place in Rust I prefer to write code that panics on failure - after all, that is what assert_eq! is doing. So in this case I would write this as
let method = r1.header("x-wasmtime-test-method").unwrap();
rather than mess around with having the alternative value around with the correct type, which is clunky.
pchickey merged PR #6161.
brendandburns created PR review comment:
Thanks, I'm still learning idiomatic rust. I will correct this in a follow-on PR.
brendandburns submitted PR review.
Last updated: Dec 23 2024 at 12:05 UTC