Просмотр исходного кода

Revert "Simplify app_version assignment with option_env macro."

This reverts commit 7cfcad95eb81c519d6f02984d562dd973e077b94.
Luther Blissett 3 лет назад
Родитель
Сommit
8f541ea8e9
4 измененных файлов с 4 добавлено и 4 удалено
  1. 1 1
      bin/darkwikid/src/main.rs
  2. 1 1
      bin/ircd/src/main.rs
  3. 1 1
      bin/tau/taud/src/main.rs
  4. 1 1
      src/net/settings.rs

+ 1 - 1
bin/darkwikid/src/main.rs

@@ -634,7 +634,7 @@ async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
     // P2p setup
     //
     let mut net_settings = settings.net.clone();
-    net_settings.app_version = option_env!("CARGO_PKG_VERSION");
+    net_settings.app_version = Some(option_env!("CARGO_PKG_VERSION").unwrap_or("").to_string());
     let (p2p_send_channel, p2p_recv_channel) = async_channel::unbounded::<NetMsg>();
 
     let p2p = net::P2p::new(net_settings.into()).await;

+ 1 - 1
bin/ircd/src/main.rs

@@ -130,7 +130,7 @@ async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
     // P2p setup
     //
     let mut net_settings = settings.net.clone();
-    net_settings.app_version = option_env!("CARGO_PKG_VERSION");
+    net_settings.app_version = Some(option_env!("CARGO_PKG_VERSION").unwrap_or("").to_string());
     let (p2p_send_channel, p2p_recv_channel) = async_channel::unbounded::<Privmsg>();
 
     let p2p = net::P2p::new(net_settings.into()).await;

+ 1 - 1
bin/tau/taud/src/main.rs

@@ -200,7 +200,7 @@ async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
     // P2p setup
     //
     let mut net_settings = settings.net.clone();
-    net_settings.app_version = option_env!("CARGO_PKG_VERSION");
+    net_settings.app_version = Some(option_env!("CARGO_PKG_VERSION").unwrap_or("").to_string());
     let (p2p_send_channel, p2p_recv_channel) = async_channel::unbounded::<NetMsg>();
 
     let p2p = net::P2p::new(net_settings.into()).await;

+ 1 - 1
src/net/settings.rs

@@ -45,7 +45,7 @@ impl Default for Settings {
             peers: Vec::new(),
             seeds: Vec::new(),
             node_id: String::new(),
-            app_version: option_env!("CARGO_PKG_VERSION"),
+            app_version: Some(option_env!("CARGO_PKG_VERSION").unwrap_or("").to_string()),
             outbound_transports: get_outbound_transports(vec![]),
             localnet: false,
         }