Skip to content

Commit c6699d6

Browse files
committed
Fix "large future" lint errors.
1 parent d6aebac commit c6699d6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/response.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use std::io::Write;
77
use crate::event::EventReceiver;
88
use crate::http_error::HttpError;
99
use crate::util::{copy_async, copy_chunked_async};
10-
use crate::{AsciiString, ContentType, Cookie, Error, EventSender, HeaderList, ResponseBody};
10+
#[cfg(feature = "include_dir")]
11+
use crate::Error;
12+
use crate::{AsciiString, ContentType, Cookie, EventSender, HeaderList, ResponseBody};
1113
use safina_sync::sync_channel;
1214
use std::fmt::Debug;
1315
use std::sync::Mutex;

src/util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub async fn copy_async(
2929
mut reader: impl AsyncRead + Unpin,
3030
mut writer: impl AsyncWrite + Unpin,
3131
) -> CopyResult {
32-
let mut buf = <FixedBuf<65536>>::new();
32+
let mut buf = Box::pin(<FixedBuf<65536>>::new());
3333
let mut num_copied = 0;
3434
loop {
3535
match reader.read(buf.writable()).await {
@@ -82,7 +82,7 @@ pub async fn copy_chunked_async(
8282
) -> CopyResult {
8383
let mut num_copied = 0;
8484
loop {
85-
let mut buf = [0_u8; 65536];
85+
let mut buf = Box::pin([0_u8; 65536]);
8686
let len = match reader.read(&mut buf[6..65534]).await {
8787
Ok(0) => break,
8888
Ok(len) => len,

tests/head.rs

+1
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ fn read_http_head_subsequent() {
341341
}
342342

343343
#[test]
344+
#[allow(clippy::redundant_clone)]
344345
fn head_derive() {
345346
let head1 = Head::try_read(&mut FixedBuf::from(
346347
*b"A /1 HTTP/1.1\r\nH1: V1\r\nh2:v2\r\n\r\n",

0 commit comments

Comments
 (0)