dont warn dead code for test utils

This commit is contained in:
programmer programmer 2022-10-27 21:21:18 +02:00
parent f78257a1fc
commit 7ebcbab9ac

View File

@ -79,6 +79,7 @@ pub fn torrent_to_magnet<T: AsRef<Path>>(torrent: T) -> Result<String, Error> {
}
// Fallible: only used in tests
#[allow(dead_code)]
pub fn find_free_port() -> u16 {
let bind = TcpListener::bind("127.0.0.1:0").unwrap();
bind.local_addr().unwrap().port()