From 0c6961772547737132f6d01da088c56a6a933888 Mon Sep 17 00:00:00 2001 From: ospab Date: Thu, 30 Jul 2026 14:41:16 +0300 Subject: [PATCH] fix(cli): trait-qualify Sha256::digest so it builds with or without the import Follow-up to the v0.4.2-beta.3 CI break. Importing sha2::Digest fixed the build there but the import reads as unused locally (different dependency resolution), leaving a permanent warning in every build. Calling through ::digest resolves the trait method explicitly, so it compiles in both environments with no import and no warning. Workspace now builds clean. --- ostp/src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ostp/src/main.rs b/ostp/src/main.rs index 33164f8..fe9dac2 100644 --- a/ostp/src/main.rs +++ b/ostp/src/main.rs @@ -3,7 +3,6 @@ use clap::Parser; use std::fs; use std::path::PathBuf; use colored::Colorize; -use sha2::Digest; #[derive(Parser, Debug)] #[command(author, version, about = "OSTP Core - Ospab Stealth Transport Protocol", long_about = None)] @@ -725,7 +724,14 @@ fn run_setup_wizard(config_path: &std::path::Path) -> Result<()> { // this used to be a DefaultHasher (SipHash) placeholder that produced a // differently-shaped digest, so a password set up through this wizard could // never actually log into the panel it just configured. - let pass_hash = format!("{:x}", sha2::Sha256::digest(password.as_bytes())); + // Trait-qualified so this compiles whether or not `sha2::Digest` happens + // to be in scope: `digest` is a trait method, and relying on the import + // alone broke the CI build once (v0.4.2-beta.3) while resolving fine + // locally. + let pass_hash = format!( + "{:x}", + ::digest(password.as_bytes()) + ); wizard_step(4, TOTAL, "Saving configuration"); let panel_bind = format!("0.0.0.0:{}", panel_port);