diff --git a/Cargo.toml b/Cargo.toml index cb839f8..698556a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ resolver = "2" [workspace.package] version = "1.0.0" authors = ["TaaS Team "] -edition = "2026" +edition = "2024" rust-version = "1.94" license = "MIT" @@ -27,7 +27,6 @@ unwrap_used = "deny" expect_used = "deny" panic = "deny" unwrap_in_result = "deny" -expect_used = "deny" unimplemented = "deny" todo = "warn" diff --git a/apps/charging-engine/src/charging/rating_billing.rs b/apps/charging-engine/src/charging/rating_billing.rs index 824dbd5..1351352 100644 --- a/apps/charging-engine/src/charging/rating_billing.rs +++ b/apps/charging-engine/src/charging/rating_billing.rs @@ -7,7 +7,7 @@ use crate::errors::{ChargingError, ChargingResult, validate_amount}; impl super::ChargingEngine { pub async fn calculate_usage_cost(&self, event: &UsageEvent) -> ChargingResult { // Get subscriber account to determine rating plan - let account = self.get_subscriber_account(&event.imsi).await?; + let _account = self.get_subscriber_account(&event.imsi).await?; // Get rating plan from Postgres (simplified - defaults to basic). let plan = self diff --git a/apps/charging-engine/src/charging/rating_plans_repo.rs b/apps/charging-engine/src/charging/rating_plans_repo.rs index bc67437..119a692 100644 --- a/apps/charging-engine/src/charging/rating_plans_repo.rs +++ b/apps/charging-engine/src/charging/rating_plans_repo.rs @@ -245,7 +245,8 @@ async fn run_migrations(database_url: &str) -> Result<(), Box Router { .and_then(|s| s.parse().ok()) .unwrap_or(20); + // Build governor config, fallback to default if None let governor_conf = GovernorConfigBuilder::default() .per_second(requests_per_second as u64) .burst_size(burst_size) .finish() - .unwrap_or_else(|_| { - // Fallback to default config if builder fails + .unwrap_or_else(|| { GovernorConfigBuilder::default() .per_second(10) .burst_size(20) .finish() - .expect("Default governor config should never fail") + .unwrap() }); Router::new() diff --git a/apps/packet-gateway/src/main.rs b/apps/packet-gateway/src/main.rs index 0fee620..e62a363 100644 --- a/apps/packet-gateway/src/main.rs +++ b/apps/packet-gateway/src/main.rs @@ -88,7 +88,7 @@ async fn main() -> Result<()> { info!("Connected to Redis successfully"); // Initialize charging engine client - let charging_client = ChargingEngineClient::new(&args.charging_engine_url); + let charging_client = ChargingEngineClient::new(args.charging_engine_url.clone()); info!("Charging engine client initialized"); #[cfg(feature = "ebpf")] @@ -167,9 +167,9 @@ async fn main() -> Result<()> { info!("Health check server listening on {}", addr); let listener = tokio::net::TcpListener::bind(&addr).await - .map_err(|e| anyhow::anyhow!("Failed to bind health check server: {}", e))?; + .expect("Failed to bind health check server"); axum::serve(listener, app).await - .map_err(|e| anyhow::anyhow!("Failed to start health check server: {}", e))?; + .expect("Failed to start health check server"); }); // Main synchronization loop with graceful shutdown