3 ms·
It's not really important whether it's assigned to a variable or not. It's important that "potentially expensive" operations like memory allocation are obvious.
by PudgePacket 6y ago
It's not really important whether it's assigned to a variable or not. It's important that "potentially expensive" operations like memory allocation are obvious. So you either need to call to_string, or call String::new("localhost").