Add must_use attribute to UserConnectionReservation and RouteConnectionLease structs for better resource management

This commit is contained in:
David Osipov
2026-03-17 19:55:55 +04:00
parent 50a827e7fd
commit 4e3f42dce3
3 changed files with 219 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ enum RouteConnectionGauge {
Middle,
}
#[must_use = "RouteConnectionLease must be kept alive to hold the connection gauge increment"]
pub struct RouteConnectionLease {
stats: Arc<Stats>,
gauge: RouteConnectionGauge,