diff --git a/worker/src/body/body.rs b/worker/src/body/body.rs index 9b9edddb..7718e133 100644 --- a/worker/src/body/body.rs +++ b/worker/src/body/body.rs @@ -3,7 +3,6 @@ use std::{ task::{Context, Poll}, }; -use crate::console_log; use crate::{ body::{wasm::WasmStreamBody, HttpBody}, futures::SendJsFuture, @@ -153,15 +152,6 @@ impl Body { .and_then(|buf| serde_json::from_slice(&buf).map_err(Error::SerdeJsonError)) } - pub(crate) fn is_none(&self) -> bool { - match &self.0 { - BodyInner::None => true, - BodyInner::Regular(_) => false, - BodyInner::Request(req) => req.body().is_none(), - BodyInner::Response(res) => res.body().is_none(), - } - } - pub(crate) fn inner(&self) -> &BodyInner { &self.0 } @@ -197,7 +187,6 @@ impl Body { .into_raw(), ), crate::body::BodyInner::None => None, - _ => panic!("unexpected body inner"), } } } @@ -323,7 +312,7 @@ impl AsyncRead for BoxBodyReader { cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll> { - if self.store.len() > 0 { + if !self.store.is_empty() { let size = self.store.len().min(buf.len()); buf[..size].clone_from_slice(&self.store[..size]); self.store = self.store.split_off(size); diff --git a/worker/src/http/request.rs b/worker/src/http/request.rs index 0552f174..a789b25e 100644 --- a/worker/src/http/request.rs +++ b/worker/src/http/request.rs @@ -1,7 +1,6 @@ //! Functions for translating requests to and from JS use wasm_bindgen::JsCast; -use worker_sys::console_log; use worker_sys::ext::{HeadersExt, RequestExt}; use crate::{AbortSignal, Cf, CfProperties};