We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.unwrap_or
1 parent 6d70977 commit ac8d96dCopy full SHA for ac8d96d
tests/helpers.rs
@@ -4,6 +4,6 @@ use std::env;
4
use std::net::TcpStream;
5
6
pub fn connect() -> mpd::Client<TcpStream> {
7
- let addr = env::var("MPD_SOCK").unwrap_or("127.0.0.1:6600".to_owned());
+ let addr = env::var("MPD_SOCK").unwrap_or_else(|_| "127.0.0.1:6600".to_owned());
8
mpd::Client::connect(&*addr).unwrap()
9
}
0 commit comments