Fix clippy lints

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2024-06-03 23:45:38 +10:00
parent 54f88e03d5
commit 1ad2d0ad87
No known key found for this signature in database
GPG key ID: 76D1E687CA3C4928

View file

@ -97,7 +97,7 @@ enum DownloadContent {
} }
impl DownloadContent { impl DownloadContent {
async fn to_response(self) -> Result<Response, DownloadError> { async fn into_response(self) -> Result<Response, DownloadError> {
Ok(match self { Ok(match self {
DownloadContent::ToIssue { client, url } => client.get(url).send(true).await?, DownloadContent::ToIssue { client, url } => client.get(url).send(true).await?,
DownloadContent::Response(response) => response, DownloadContent::Response(response) => response,
@ -163,7 +163,7 @@ impl<'a> Download<'a> {
let mut data_verifier = self.data_verifier; let mut data_verifier = self.data_verifier;
Ok(self Ok(self
.content .content
.to_response() .into_response()
.await? .await?
.bytes_stream() .bytes_stream()
.map(move |res| { .map(move |res| {
@ -272,7 +272,7 @@ impl Download<'_> {
#[instrument] #[instrument]
pub async fn into_bytes(self) -> Result<Bytes, DownloadError> { pub async fn into_bytes(self) -> Result<Bytes, DownloadError> {
let bytes = self.content.to_response().await?.bytes().await?; let bytes = self.content.into_response().await?.bytes().await?;
if let Some(verifier) = self.data_verifier { if let Some(verifier) = self.data_verifier {
verifier.update(&bytes); verifier.update(&bytes);
} }