.168.0.1:3000&quot;.to_string();
// TcpStream::connect(&amp;*addr_string); // convert addr_string to &amp;str
TcpStream::connect(&amp;*addr_string); // addr_string を &amp;str に変換して渡す
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>net</span>::<span class='ident'>TcpStream</span>;

<span class='ident'>TcpStream</span>::<span class='ident'>connect</span>(<span class='string'>&quot;192.168.0.1:3000&quot;</span>); <