Skip to content

Commit f2b1ae7

Browse files
alphaqiuclaude
andcommitted
fix: resolve CI/CD failures (clippy warnings and OpenSSL cross-compilation)
Clippy fixes: - Add #![allow(ambiguous_glob_reexports)] to cli/commands/mod.rs - Remove unused imports (Alignment, DisableMouseCapture, etc.) - Replace deprecated rand::thread_rng() with rand::rng() - Replace deprecated frame.size() with frame.area() - Replace deprecated frame.set_cursor() with frame.set_cursor_position() - Fix unreachable pattern in TUI (Ctrl-D -> Ctrl-Q) - Remove unnecessary mut keywords - Add #![allow(dead_code)] to tui/widgets/mod.rs OpenSSL cross-compilation fix: - Use reqwest feature "native-tls-vendored" for static OpenSSL linking - Eliminates need for system OpenSSL libraries in CI - Fixes cross-compilation for Linux ARM64 Workflow updates: - Remove pkg-config libssl-dev from build.yml and test.yml - Simplify cross-compilation setup (no need for OpenSSL headers) This resolves: - Clippy errors blocking test workflow - OpenSSL cross-compilation errors for Linux ARM64 - All workflows should now pass Co-Authored-By: Claude (glm-4.7) <noreply@anthropic.com>
1 parent 75dc37f commit f2b1ae7

17 files changed

Lines changed: 47 additions & 37 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ jobs:
9797
- name: Install Rust toolchain
9898
uses: dtolnay/rust-toolchain@stable
9999

100-
- name: Install dependencies
101-
run: |
102-
sudo apt-get update
103-
sudo apt-get install -y pkg-config libssl-dev
104-
105100
- name: Cache cargo
106101
uses: actions/cache@v4
107102
with:

.github/workflows/test.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ jobs:
2929
with:
3030
toolchain: ${{ matrix.rust }}
3131

32-
- name: Install dependencies (Linux)
33-
if: runner.os == 'Linux'
34-
run: |
35-
sudo apt-get update
36-
sudo apt-get install -y pkg-config libssl-dev
37-
3832
- name: Cache cargo
3933
uses: actions/cache@v4
4034
with:

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ tokio = { version = "1.38", features = ["full"] }
6262
async-trait = "0.1"
6363

6464
# HTTP client for HIBP API
65-
reqwest = { version = "0.12", features = ["json"] }
65+
# Use native-tls-vendored for static OpenSSL linking to avoid cross-compilation issues
66+
reqwest = { version = "0.12", features = ["json", "native-tls-vendored"] }
6667

6768
# YAML configuration
6869
serde_yaml = "0.9"

src/cli/commands/generate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub fn generate_random(length: usize, numbers: bool, symbols: bool) -> Result<St
177177
}
178178

179179
let chars: Vec<char> = charset.chars().collect();
180-
let mut rng = rand::thread_rng();
180+
let mut rng = rand::rng();
181181

182182
// Build password ensuring required character types are included
183183
let mut password_chars: Vec<char> = Vec::with_capacity(length);
@@ -235,7 +235,7 @@ pub fn generate_memorable(word_count: usize) -> Result<String> {
235235
});
236236
}
237237

238-
let mut rng = rand::thread_rng();
238+
let mut rng = rand::rng();
239239
let selected: Vec<&str> = WORDS.choose_multiple(&mut rng, word_count)
240240
.map(|w| *w)
241241
.collect();
@@ -276,7 +276,7 @@ pub fn generate_pin(length: usize) -> Result<String> {
276276

277277
// Use only 2-9 to avoid ambiguous 0 and 1
278278
let digits = [b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9'];
279-
let mut rng = rand::thread_rng();
279+
let mut rng = rand::rng();
280280
let pin: String = (0..length)
281281
.map(|_| {
282282
let idx = rng.random_range(0..digits.len());

src/cli/commands/health.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub async fn check_health(args: HealthArgs) -> Result<()> {
3131

3232
let config = ConfigManager::new()?;
3333
let db_config = config.get_database_config()?;
34-
let mut db = DatabaseManager::new(&db_config.path)?;
34+
let db = DatabaseManager::new(&db_config.path)?;
3535

3636
// Initialize crypto manager (prompt for master password if needed)
3737
let mut crypto = CryptoManager::new();

src/cli/commands/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! CLI Command Implementations
22
3+
// Allow glob re-exports - command modules may have functions with same names
4+
#![allow(ambiguous_glob_reexports)]
5+
36
pub mod config;
47
pub mod generate;
58
pub mod list;

src/crypto/argon2id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn derive_key_with_params(
115115

116116
/// Generate a random 16-byte salt
117117
pub fn generate_salt() -> [u8; 16] {
118-
rand::thread_rng().random()
118+
rand::rng().random()
119119
}
120120

121121
/// Stored password hash with salt and parameters

src/crypto/keystore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn derive_master_key(password: &str, salt: &[u8; 16]) -> Result<[u8; 32]> {
133133

134134
fn generate_random_key() -> [u8; 32] {
135135
let mut key = [0u8; 32];
136-
rand::thread_rng().fill_bytes(&mut key);
136+
rand::rng().fill_bytes(&mut key);
137137
key
138138
}
139139

src/crypto/keywrap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ impl KeyHierarchy {
8181
fn generate_dek() -> Result<DataEncryptionKey> {
8282
use rand::Rng;
8383
let mut key = [0u8; 32];
84-
rand::thread_rng().fill(&mut key);
84+
rand::rng().fill(&mut key);
8585
Ok(DataEncryptionKey(key))
8686
}
8787

8888
fn generate_recovery_key() -> Result<RecoveryKey> {
8989
use rand::Rng;
9090
let mut key = [0u8; 32];
91-
rand::thread_rng().fill(&mut key);
91+
rand::rng().fill(&mut key);
9292
Ok(RecoveryKey(key))
9393
}
9494

9595
fn generate_device_key() -> Result<DeviceKey> {
9696
use rand::Rng;
9797
let mut key = [0u8; 32];
98-
rand::thread_rng().fill(&mut key);
98+
rand::rng().fill(&mut key);
9999
Ok(DeviceKey(key))
100100
}
101101
}

0 commit comments

Comments
 (0)