Fixed compilation warnings on unreachable code when compiling with features flag (#215)

This commit is contained in:
Jędrzej Stuczyński
2020-05-05 13:16:56 +01:00
committed by GitHub
parent 20b25b1074
commit fa1bcabe5a
5 changed files with 35 additions and 30 deletions
+7 -6
View File
@@ -277,12 +277,13 @@ impl Default for Client {
impl Client {
fn default_directory_server() -> String {
#[cfg(feature = "qa")]
return "https://qa-directory.nymtech.net".to_string();
#[cfg(feature = "local")]
return "http://localhost:8080".to_string();
"https://directory.nymtech.net".to_string()
if cfg!(feature = "qa") {
"https://qa-directory.nymtech.net".to_string()
} else if cfg!(feature = "local") {
"http://localhost:8080".to_string()
} else {
"https://directory.nymtech.net".to_string()
}
}
fn default_private_identity_key_file(id: &str) -> PathBuf {
+7 -6
View File
@@ -542,12 +542,13 @@ pub struct Debug {
impl Debug {
fn default_directory_server() -> String {
#[cfg(feature = "qa")]
return "https://qa-directory.nymtech.net".to_string();
#[cfg(feature = "local")]
return "http://localhost:8080".to_string();
"https://directory.nymtech.net".to_string()
if cfg!(feature = "qa") {
"https://qa-directory.nymtech.net".to_string()
} else if cfg!(feature = "local") {
"http://localhost:8080".to_string()
} else {
"https://directory.nymtech.net".to_string()
}
}
}
+7 -6
View File
@@ -376,12 +376,13 @@ pub struct Debug {
impl Debug {
fn default_directory_server() -> String {
#[cfg(feature = "qa")]
return "https://qa-directory.nymtech.net".to_string();
#[cfg(feature = "local")]
return "http://localhost:8080".to_string();
"https://directory.nymtech.net".to_string()
if cfg!(feature = "qa") {
"https://qa-directory.nymtech.net".to_string()
} else if cfg!(feature = "local") {
"http://localhost:8080".to_string()
} else {
"https://directory.nymtech.net".to_string()
}
}
}
+7 -6
View File
@@ -511,12 +511,13 @@ pub struct Debug {
impl Debug {
fn default_directory_server() -> String {
#[cfg(feature = "qa")]
return "https://qa-directory.nymtech.net".to_string();
#[cfg(feature = "local")]
return "http://localhost:8080".to_string();
"https://directory.nymtech.net".to_string()
if cfg!(feature = "qa") {
"https://qa-directory.nymtech.net".to_string()
} else if cfg!(feature = "local") {
"http://localhost:8080".to_string()
} else {
"https://directory.nymtech.net".to_string()
}
}
}
+7 -6
View File
@@ -84,12 +84,13 @@ impl NymConfig for Config {
impl Config {
fn default_directory_server() -> String {
#[cfg(feature = "qa")]
return "https://qa-directory.nymtech.net".to_string();
#[cfg(feature = "local")]
return "http://localhost:8080".to_string();
"https://directory.nymtech.net".to_string()
if cfg!(feature = "qa") {
"https://qa-directory.nymtech.net".to_string()
} else if cfg!(feature = "local") {
"http://localhost:8080".to_string()
} else {
"https://directory.nymtech.net".to_string()
}
}
pub fn new<S: Into<String>>(id: S) -> Self {