test(common): remove PortReservation::release

With the archive tests on the shared fixture, no test releases a
reservation before a service binds its port. Remove the method so the
only way to start a service on a reserved address is to transfer the
bound listener, which keeps the address held for the child's lifetime.

Validation: `cargo check -p ngit-grasp --tests` finds no remaining
caller.

Assisted-by: Claude Fable 5.1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
DanConwayDev
2026-09-18 14:36:54 +00:00
co-authored by Claude Fable 5.1
parent fe1793d707
commit c6781f10d3
+2 -10
View File
@@ -16,8 +16,8 @@ use std::net::TcpListener;
/// process can be handed the same number. /// process can be handed the same number.
/// ///
/// Transfer it with [`PortReservation::into_std_listener`] to start a service /// Transfer it with [`PortReservation::into_std_listener`] to start a service
/// without releasing its address. Dropping it or calling `release` relinquishes /// without releasing its address. Dropping it relinquishes the address, so a
/// the address and must not be used before starting a replacement service. /// reservation must be transferred, not dropped, to start a service on it.
#[derive(Debug)] #[derive(Debug)]
pub struct PortReservation { pub struct PortReservation {
port: u16, port: u16,
@@ -59,14 +59,6 @@ impl PortReservation {
_listener: listener, _listener: listener,
} }
} }
/// Relinquish the address. A later bind to this port is inherently racy.
pub fn release(self) -> u16 {
let port = self.port;
// `self` is consumed; the listener inside is dropped here.
drop(self);
port
}
} }
/// Bind `127.0.0.1:0`, capture the assigned port, and **keep the listener /// Bind `127.0.0.1:0`, capture the assigned port, and **keep the listener