Skip to content

Commit 4e0e8a6

Browse files
authored
Rust: Use LOCALHOST const (#492)
1 parent c4c51ea commit 4e0e8a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/rust/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#[macro_export]
22
macro_rules! notify {
33
($($arg:tt)*) => {{
4-
if let Ok(mut stream) = std::net::TcpStream::connect(("127.0.0.1", 9001)) {
4+
use std::net::{Ipv4Addr, TcpStream};
5+
6+
if let Ok(mut stream) = TcpStream::connect((Ipv4Addr::LOCALHOST, 9001)) {
57
_ = write!(stream, $($arg)*);
68
}
79
}};

0 commit comments

Comments
 (0)