fix two clippy lints

This commit is contained in:
Bennet Bleßmann
2024-05-28 19:59:32 +02:00
parent 80a0cab6ab
commit 1a9d10d298
2 changed files with 7 additions and 8 deletions

View File

@@ -24,7 +24,6 @@ use std::io;
#[cfg(feature = "http")] #[cfg(feature = "http")]
use std::io::BufRead; use std::io::BufRead;
use std::io::{Cursor, ErrorKind, Read, Seek, SeekFrom, Write}; use std::io::{Cursor, ErrorKind, Read, Seek, SeekFrom, Write};
use std::mem;
use std::net::{Shutdown, TcpStream}; use std::net::{Shutdown, TcpStream};
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use std::path::PathBuf; use std::path::PathBuf;
@@ -296,9 +295,9 @@ impl Read for HttpReadStream {
#[cfg(feature = "http")] #[cfg(feature = "http")]
pub struct HttpWriteStream { pub struct HttpWriteStream {
status_code: u16, status_code: u16,
headers: mem::ManuallyDrop<hyper::HeaderMap>, headers: std::mem::ManuallyDrop<hyper::HeaderMap>,
response: TypedArenaPtr<HttpResponse>, response: TypedArenaPtr<HttpResponse>,
buffer: mem::ManuallyDrop<Vec<u8>>, buffer: std::mem::ManuallyDrop<Vec<u8>>,
} }
#[cfg(feature = "http")] #[cfg(feature = "http")]
@@ -325,8 +324,8 @@ impl Write for HttpWriteStream {
#[cfg(feature = "http")] #[cfg(feature = "http")]
impl HttpWriteStream { impl HttpWriteStream {
fn drop(&mut self) { fn drop(&mut self) {
let headers = unsafe { mem::ManuallyDrop::take(&mut self.headers) }; let headers = unsafe { std::mem::ManuallyDrop::take(&mut self.headers) };
let buffer = unsafe { mem::ManuallyDrop::take(&mut self.buffer) }; let buffer = unsafe { std::mem::ManuallyDrop::take(&mut self.buffer) };
let (ready, response, cvar) = &**self.response; let (ready, response, cvar) = &**self.response;
@@ -1228,8 +1227,8 @@ impl Stream {
StreamLayout::new(CharReader::new(HttpWriteStream { StreamLayout::new(CharReader::new(HttpWriteStream {
response, response,
status_code, status_code,
headers: mem::ManuallyDrop::new(headers), headers: std::mem::ManuallyDrop::new(headers),
buffer: mem::ManuallyDrop::new(Vec::new()), buffer: std::mem::ManuallyDrop::new(Vec::new()),
})), })),
arena arena
)) ))

View File

@@ -109,7 +109,7 @@ pub(crate) fn as_partial_string(
tail_ref = succ; tail_ref = succ;
} }
Term::PartialString(_, pstr, tail) => { Term::PartialString(_, pstr, tail) => {
string += &pstr; string += pstr;
tail_ref = tail; tail_ref = tail;
} }
Term::CompleteString(_, cstr) => { Term::CompleteString(_, cstr) => {