chore: fix beta clippy warnings

This commit is contained in:
link2xt
2023-08-28 03:23:30 +00:00
parent 3e07f2c173
commit 9ef34890fa
3 changed files with 10 additions and 10 deletions

View File

@@ -155,8 +155,8 @@ impl<'a> Connection<'a> {
pub(crate) async fn perform_job(context: &Context, mut connection: Connection<'_>, mut job: Job) {
info!(context, "Job {} started...", &job);
let try_res = match perform_job_action(context, &mut job, &mut connection, 0).await {
Status::RetryNow => perform_job_action(context, &mut job, &mut connection, 1).await,
let try_res = match perform_job_action(context, &job, &mut connection, 0).await {
Status::RetryNow => perform_job_action(context, &job, &mut connection, 1).await,
x => x,
};
@@ -205,7 +205,7 @@ pub(crate) async fn perform_job(context: &Context, mut connection: Connection<'_
async fn perform_job_action(
context: &Context,
job: &mut Job,
job: &Job,
connection: &mut Connection<'_>,
tries: u32,
) -> Status {

View File

@@ -71,7 +71,7 @@ async fn get_unique_quota_roots_and_usage(
// messages could be received and so the usage could have been changed
*unique_quota_roots
.entry(quota_root_name.clone())
.or_insert_with(Vec::new) = quota.resources;
.or_default() = quota.resources;
}
}
}

View File

@@ -707,7 +707,7 @@ fn parse_webxdc_manifest(bytes: &[u8]) -> Result<WebxdcManifest> {
Ok(manifest)
}
async fn get_blob(archive: &mut async_zip::read::fs::ZipFileReader, name: &str) -> Result<Vec<u8>> {
async fn get_blob(archive: &async_zip::read::fs::ZipFileReader, name: &str) -> Result<Vec<u8>> {
let (i, _) = find_zip_entry(archive.file(), name)
.ok_or_else(|| anyhow!("no entry found for {}", name))?;
let mut reader = archive.entry(i).await?;
@@ -750,10 +750,10 @@ impl Message {
name
};
let mut archive = self.get_webxdc_archive(context).await?;
let archive = self.get_webxdc_archive(context).await?;
if name == "index.html" {
if let Ok(bytes) = get_blob(&mut archive, "manifest.toml").await {
if let Ok(bytes) = get_blob(&archive, "manifest.toml").await {
if let Ok(manifest) = parse_webxdc_manifest(&bytes) {
if let Some(min_api) = manifest.min_api {
if min_api > WEBXDC_API_VERSION {
@@ -766,15 +766,15 @@ impl Message {
}
}
get_blob(&mut archive, name).await
get_blob(&archive, name).await
}
/// Return info from manifest.toml or from fallbacks.
pub async fn get_webxdc_info(&self, context: &Context) -> Result<WebxdcInfo> {
ensure!(self.viewtype == Viewtype::Webxdc, "No webxdc instance.");
let mut archive = self.get_webxdc_archive(context).await?;
let archive = self.get_webxdc_archive(context).await?;
let mut manifest = get_blob(&mut archive, "manifest.toml")
let mut manifest = get_blob(&archive, "manifest.toml")
.await
.map(|bytes| parse_webxdc_manifest(&bytes).unwrap_or_default())
.unwrap_or_default();