From 33e9acc06c225b1ebe6b97437e65f8ac419a19a1 Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Tue, 25 Jun 2024 16:03:56 -0700 Subject: [PATCH] Clarify comment --- lib/src/async_io.rs | 5 ++++- lib/src/wiggle_abi/req_impl.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/src/async_io.rs b/lib/src/async_io.rs index ba0dcca6..d55780f5 100644 --- a/lib/src/async_io.rs +++ b/lib/src/async_io.rs @@ -26,7 +26,10 @@ impl FastlyAsyncIo for Session { let select_fut = self .select_impl( memory - // TODO: wiggle only supports slices of u8 in 22.0.0 + // TODO: `GuestMemory::as_slice` only supports guest pointers to u8 slices in + // wiggle 22.0.0, but `GuestMemory::to_vec` supports slices to arbitrary types. + // Once wiggle supports making slices to guest memory of arbitrary types, we + // should switch this back to `as_slice` to avoid reifying the whole vector. .to_vec(handles)? .into_iter() .map(|i| AsyncItemHandle::from(i).into()), diff --git a/lib/src/wiggle_abi/req_impl.rs b/lib/src/wiggle_abi/req_impl.rs index 25de8f17..e7f768e3 100644 --- a/lib/src/wiggle_abi/req_impl.rs +++ b/lib/src/wiggle_abi/req_impl.rs @@ -846,7 +846,10 @@ impl FastlyHttpReq for Session { let done_index = self .select_impl( memory - // TODO: wiggle only supports slices of u8 in 22.0.0 + // TODO: `GuestMemory::as_slice` only supports guest pointers to u8 slices in + // wiggle 22.0.0, but `GuestMemory::to_vec` supports slices to arbitrary types. + // Once wiggle supports making slices to guest memory of arbitrary types, we + // should switch this back to `as_slice` to avoid reifying the whole vector. .to_vec(pending_req_handles)? .into_iter() .map(|handle| PendingRequestHandle::from(handle).into()),