Skip to content

Commit f512a89

Browse files
committed
fix(lint): resolve cargo fmt and clippy violations across workspace
1 parent c911d3c commit f512a89

5 files changed

Lines changed: 38 additions & 17 deletions

File tree

apps/backend/src/app/rate_limit.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ struct RateLimiterInner {
2626
limit_per_min: u32,
2727
}
2828

29+
impl Default for RateLimiter {
30+
fn default() -> Self {
31+
Self::new()
32+
}
33+
}
34+
2935
impl RateLimiter {
3036
pub fn new() -> Self {
3137
let limit_per_min = env_u64("RATE_LIMIT_PER_MIN", 60) as u32;

apps/backend/src/app/scan.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use crate::domain::{BaselineInfo, ScanProfileInput, ScanRequest, ScanResponse};
2-
use std::path::{Path, PathBuf};
2+
use std::path::Path;
33
use std::time::Instant;
44
use thiserror::Error;
5-
use verifyos_cli::core::engine::{Engine, OrchestratorError};
5+
use verifyos_cli::core::engine::Engine;
66
use verifyos_cli::profiles::{available_rule_ids, normalize_rule_id, register_rules, RuleSelection, ScanProfile};
77
use verifyos_cli::report::{apply_baseline, build_report, BaselineSummary, ReportData};
8-
use zip::ZipArchive;
98

109
#[derive(Debug, Error)]
1110
pub enum ScanError {
@@ -21,6 +20,12 @@ pub struct ScanOutcome {
2120
pub baseline: Option<BaselineSummary>,
2221
}
2322

23+
impl Default for ScanService {
24+
fn default() -> Self {
25+
Self::new()
26+
}
27+
}
28+
2429
impl ScanService {
2530
pub fn new() -> Self {
2631
Self
@@ -67,7 +72,6 @@ impl ScanService {
6772
}
6873
}
6974

70-
let run_started = Instant::now();
7175
let bundle_path = bundle_path.as_ref();
7276
let run = engine.run(bundle_path)
7377
.map_err(|err| ScanError::ScanFailed(err.to_string()))?;

src/rules/privacy_manifest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ impl AppStoreRule for PrivacyManifestCompletenessRule {
4040
Err(_) => {
4141
return Ok(RuleReport {
4242
status: RuleStatus::Skip,
43-
message: Some("PrivacyInfo.xcprivacy is empty or invalid; skipping".to_string()),
43+
message: Some(
44+
"PrivacyInfo.xcprivacy is empty or invalid; skipping".to_string(),
45+
),
4446
evidence: Some(manifest_path.display().to_string()),
4547
});
4648
}

src/rules/privacy_sdk.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ impl AppStoreRule for PrivacyManifestSdkCrossCheckRule {
4040
Err(_) => {
4141
return Ok(RuleReport {
4242
status: RuleStatus::Skip,
43-
message: Some("PrivacyInfo.xcprivacy is empty or invalid; skipping".to_string()),
43+
message: Some(
44+
"PrivacyInfo.xcprivacy is empty or invalid; skipping".to_string(),
45+
),
4446
evidence: Some(manifest_path.display().to_string()),
4547
});
4648
}

src/rules/xcode_requirements.rs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,45 @@ impl AppStoreRule for XcodeVersionRule {
4040
let dtxcode = plist.get_string("DTXcode");
4141
if let Some(version_str) = dtxcode {
4242
if let Ok(version_int) = version_str.parse::<u32>() {
43-
if version_int < 1800 { // Assuming 2600 is Xcode 26, but let's be conservative for now or use a heuristic
43+
if version_int < 1800 {
44+
// Assuming 2600 is Xcode 26, but let's be conservative for now or use a heuristic
4445
// Note: User specified 2026 mandate usually corresponds to next major version.
4546
// If current is Xcode 15/16, Xcode 26 is far off, but the prompt says 2026.
4647
// Actually, Xcode versions don't jump to 26 that fast.
47-
// Wait, maybe the user meant Xcode 17 or 18?
48+
// Wait, maybe the user meant Xcode 17 or 18?
4849
// Let's check the prompt again: "Xcode 26+... build bằng Xcode 26 và iOS 26 SDK"
4950
// That's a very high version number. Maybe it's a future-proof check.
50-
51+
5152
if version_int < 2600 {
52-
failures.push(format!("Built with Xcode version {} (required 2600+)", version_str));
53+
failures.push(format!(
54+
"Built with Xcode version {} (required 2600+)",
55+
version_str
56+
));
5357
}
5458
}
5559
}
5660
} else {
57-
failures.push("DTXcode key missing".to_string());
61+
failures.push("DTXcode key missing".to_string());
5862
}
5963

6064
// 2. Check DTPlatformVersion (e.g., "18.0")
6165
let platform_version = plist.get_string("DTPlatformVersion");
6266
if let Some(version) = platform_version {
63-
if let Ok(v) = version.parse::<f32>() {
64-
if v < 26.0 {
65-
failures.push(format!("Built with platform version {} (required 26.0+)", version));
66-
}
67-
}
67+
if let Ok(v) = version.parse::<f32>() {
68+
if v < 26.0 {
69+
failures.push(format!(
70+
"Built with platform version {} (required 26.0+)",
71+
version
72+
));
73+
}
74+
}
6875
}
6976

7077
// 3. Check DTSDKName (e.g., "iphoneos18.0")
7178
let sdk_name = plist.get_string("DTSDKName");
7279
if let Some(name) = sdk_name {
7380
if !name.contains("26") {
74-
failures.push(format!("Built with SDK {} (required iOS 26 SDK)", name));
81+
failures.push(format!("Built with SDK {} (required iOS 26 SDK)", name));
7582
}
7683
}
7784

0 commit comments

Comments
 (0)