Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kflansburg committed Jan 24, 2024
1 parent e7caadc commit a655664
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
13 changes: 1 addition & 12 deletions worker/src/body/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::{
task::{Context, Poll},
};

use crate::console_log;
use crate::{
body::{wasm::WasmStreamBody, HttpBody},
futures::SendJsFuture,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -197,7 +187,6 @@ impl Body {
.into_raw(),
),
crate::body::BodyInner::None => None,
_ => panic!("unexpected body inner"),
}
}
}
Expand Down Expand Up @@ -323,7 +312,7 @@ impl AsyncRead for BoxBodyReader {
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<Result<usize, std::io::Error>> {
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);
Expand Down
1 change: 0 additions & 1 deletion worker/src/http/request.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down

0 comments on commit a655664

Please sign in to comment.