From b7e86bf55654830625434fa96c5d474dcffccac6 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Mon, 16 May 2022 16:00:01 -0600 Subject: [PATCH] cleanse warnings --- backend/src/config/spec.rs | 2 +- backend/src/control.rs | 6 +++--- backend/src/db/package.rs | 2 +- backend/src/install/cleanup.rs | 2 +- backend/src/manager/health.rs | 2 +- backend/src/s9pk/header.rs | 4 ++-- backend/src/setup.rs | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/backend/src/config/spec.rs b/backend/src/config/spec.rs index 1a01f3af2..488252b8a 100644 --- a/backend/src/config/spec.rs +++ b/backend/src/config/spec.rs @@ -2045,7 +2045,7 @@ impl ValueSpec for SystemPointerSpec { _config_overrides: &BTreeMap, value: &mut Value, - receipts: &ConfigPointerReceipts, + _receipts: &ConfigPointerReceipts, ) -> Result<(), ConfigurationError> { *value = self.deref(db).await?; Ok(()) diff --git a/backend/src/control.rs b/backend/src/control.rs index 947bc4fba..3b8fb5df6 100644 --- a/backend/src/control.rs +++ b/backend/src/control.rs @@ -5,17 +5,17 @@ use patch_db::{DbHandle, LockReceipt, LockType}; use rpc_toolkit::command; use tracing::instrument; +use crate::context::RpcContext; use crate::db::util::WithRevision; use crate::dependencies::{ break_all_dependents_transitive, heal_all_dependents_transitive, BreakageRes, DependencyError, - TaggedDependencyError, + DependencyReceipt, TaggedDependencyError, }; use crate::s9pk::manifest::PackageId; use crate::status::MainStatus; use crate::util::display_none; use crate::util::serde::display_serializable; -use crate::{context::RpcContext, dependencies::DependencyReceipt}; -use crate::{Error, ResultExt}; +use crate::Error; #[derive(Clone)] pub struct StartReceipts { diff --git a/backend/src/db/package.rs b/backend/src/db/package.rs index ea4fb9428..dd167c160 100644 --- a/backend/src/db/package.rs +++ b/backend/src/db/package.rs @@ -50,7 +50,7 @@ impl ManifestReceipts { pub fn setup( locks: &mut Vec, - id: &PackageId, + _id: &PackageId, ) -> impl FnOnce(&Verifier) -> Result { let manifest = crate::db::DatabaseModel::new() .package_data() diff --git a/backend/src/install/cleanup.rs b/backend/src/install/cleanup.rs index 282a4ac93..aa2b52ce4 100644 --- a/backend/src/install/cleanup.rs +++ b/backend/src/install/cleanup.rs @@ -17,7 +17,7 @@ use crate::dependencies::{ use crate::error::ErrorCollection; use crate::s9pk::manifest::{Manifest, PackageId}; use crate::util::{Apply, Version}; -use crate::volume::{asset_dir, script_dir, PKG_VOLUME_DIR}; +use crate::volume::{asset_dir, script_dir}; use crate::Error; pub struct UpdateDependencyReceipts { diff --git a/backend/src/manager/health.rs b/backend/src/manager/health.rs index fc0e66974..5e9b8a62f 100644 --- a/backend/src/manager/health.rs +++ b/backend/src/manager/health.rs @@ -4,12 +4,12 @@ use std::sync::atomic::{AtomicBool, Ordering}; use patch_db::{DbHandle, LockType}; use tracing::instrument; +use crate::context::RpcContext; use crate::dependencies::{break_transitive, heal_transitive, DependencyError}; use crate::s9pk::manifest::PackageId; use crate::status::health_check::{HealthCheckId, HealthCheckResult}; use crate::status::MainStatus; use crate::Error; -use crate::{context::RpcContext, dependencies::BreakTransitiveReceipts}; #[instrument(skip(ctx, db))] pub async fn check( diff --git a/backend/src/s9pk/header.rs b/backend/src/s9pk/header.rs index 9e6bb8e4f..f07f22e14 100644 --- a/backend/src/s9pk/header.rs +++ b/backend/src/s9pk/header.rs @@ -20,7 +20,7 @@ impl Header { pub fn placeholder() -> Self { Header { pubkey: PublicKey::default(), - signature: Signature::new([0; 64]), + signature: Signature::from_bytes(&[0; 64]).expect("Invalid ed25519 signature"), table_of_contents: Default::default(), } } @@ -56,7 +56,7 @@ impl Header { .map_err(|e| Error::new(e, crate::ErrorKind::ParseS9pk))?; let mut sig_bytes = [0; 64]; reader.read_exact(&mut sig_bytes).await?; - let signature = Signature::new(sig_bytes); + let signature = Signature::from_bytes(&sig_bytes).expect("Invalid ed25519 signature"); let table_of_contents = TableOfContents::deserialize(reader).await?; Ok(Header { diff --git a/backend/src/setup.rs b/backend/src/setup.rs index 7b92923fc..1a8b67598 100644 --- a/backend/src/setup.rs +++ b/backend/src/setup.rs @@ -95,14 +95,14 @@ pub async fn attach( #[context] ctx: SetupContext, #[arg] guid: Arc, ) -> Result { - crate::disk::main::import( + let _ = crate::disk::main::import( &*guid, &ctx.datadir, RepairStrategy::Preen, DEFAULT_PASSWORD, ) .await?; - let mut product_key = ctx.product_key().await?; + let product_key = ctx.product_key().await?; let product_key_path = Path::new("/embassy-data/main/product_key.txt"); if tokio::fs::metadata(product_key_path).await.is_ok() { let pkey = Arc::new( @@ -315,7 +315,7 @@ pub async fn execute_inner( ) .await?, ); - crate::disk::main::import( + let _ = crate::disk::main::import( &*guid, &ctx.datadir, RepairStrategy::Preen,