refactor: Remove unnecessary clone() calls and improve error handling in packet-gateway

- Remove clone() from rating plan parameter in add_rating_plan call
- Remove clone() calls from ChargingEngineClient and EbpfManager initialization
- Remove clone() from Redis client Arc wrapping
- Remove clone() calls from PacketGatewayConfig field assignments
- Replace expect() with proper error handling using map_err and anyhow in health check server
- Remove clone() from IP string in session data collection
This commit is contained in:
nutcas3
2026-04-29 04:21:52 +03:00
parent b3ff568bd4
commit 4cc0b80b1c
2 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ pub async fn add_rating_plan(
sms_limit: req.get("sms_limit").and_then(|v| v.as_u64()).unwrap_or(100),
};
state.charging_engine.add_rating_plan(plan.clone()).await
state.charging_engine.add_rating_plan(plan).await
.with_context("Failed to add rating plan")?;
Ok(Json(serde_json::json!({