forked from proxmox-mirrors/proxmox
http: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
59986f1195
commit
179515c5b2
@ -83,8 +83,8 @@ impl SimpleHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn request(&self, mut request: Request<Body>) -> Result<Response<Body>, Error> {
|
pub async fn request(&self, mut request: Request<Body>) -> Result<Response<Body>, Error> {
|
||||||
let user_agent = if let Some(ref user_agent) = self.options.user_agent {
|
let user_agent = if let Some(user_agent) = &self.options.user_agent {
|
||||||
HeaderValue::from_str(&user_agent)?
|
HeaderValue::from_str(user_agent)?
|
||||||
} else {
|
} else {
|
||||||
HeaderValue::from_str(Self::DEFAULT_USER_AGENT_STRING)?
|
HeaderValue::from_str(Self::DEFAULT_USER_AGENT_STRING)?
|
||||||
};
|
};
|
||||||
|
@ -609,13 +609,12 @@ impl<R: AsyncRead + Unpin + Send + 'static> AsyncRead for WebSocketReader<R> {
|
|||||||
ReaderState::HaveData
|
ReaderState::HaveData
|
||||||
};
|
};
|
||||||
this.read_buffer = Some(read_buffer);
|
this.read_buffer = Some(read_buffer);
|
||||||
continue;
|
|
||||||
} else {
|
} else {
|
||||||
this.header = Some(header);
|
this.header = Some(header);
|
||||||
this.read_buffer = Some(read_buffer);
|
this.read_buffer = Some(read_buffer);
|
||||||
this.state = ReaderState::NoData;
|
this.state = ReaderState::NoData;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let len = min(buf.remaining(), min(header.payload_len, read_buffer.len()));
|
let len = min(buf.remaining(), min(header.payload_len, read_buffer.len()));
|
||||||
|
Loading…
Reference in New Issue
Block a user