From 3ca85a4749dea63ebd0fdca0d3982016a34e6e9d Mon Sep 17 00:00:00 2001 From: Xerxes-2 Date: Tue, 19 Aug 2025 16:59:24 +1000 Subject: [PATCH] refactor: generalize write_validated_key_to_tier_files function to use type parameter for file handles --- src/adapters/output/local.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/adapters/output/local.rs b/src/adapters/output/local.rs index 747ade6..2086e88 100644 --- a/src/adapters/output/local.rs +++ b/src/adapters/output/local.rs @@ -6,11 +6,14 @@ use toml::Value; use tracing::info; // Write valid key to appropriate tier file -pub async fn write_validated_key_to_tier_files( - free_file: &mut (impl AsyncWrite + Unpin), - paid_file: &mut (impl AsyncWrite + Unpin), +pub async fn write_validated_key_to_tier_files( + free_file: &mut W, + paid_file: &mut W, validated_key: &ValidatedKey, -) -> Result<(), ValidatorError> { +) -> Result<(), ValidatorError> +where + W: AsyncWrite + Unpin, +{ match validated_key.tier { KeyTier::Free => { free_file