From 1fb3194786052fa0a73c606cfce773ca0f17348d Mon Sep 17 00:00:00 2001 From: Artlef Date: Wed, 5 Aug 2020 22:51:33 +0200 Subject: [PATCH] Print version in log Release 0.2.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/bin/client.rs | 6 ++++-- src/bin/server.rs | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac1d700..daf159a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clichess" -version = "0.1.0" +version = "0.2.0" dependencies = [ "colored 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index acc805b..59f3189 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clichess" -version = "0.1.0" +version = "0.2.0" authors = ["Artlef "] edition = "2018" diff --git a/src/bin/client.rs b/src/bin/client.rs index f7f2479..513e62f 100644 --- a/src/bin/client.rs +++ b/src/bin/client.rs @@ -19,6 +19,8 @@ struct Client { } fn main() { + let version = env!("CARGO_PKG_VERSION"); + println!("Running clichess version {}", version); let username = std::env::args().nth(1).expect("no name given"); let public_key = std::env::args().nth(2).expect("no public key given"); //send username and public key to server @@ -41,8 +43,8 @@ fn main() { let mut client = Client { player: clichess::Player { role: UserRole::Spectator, - username: username, - public_key: public_key, + username, + public_key, }, side: Color::White, input_buffer: input_buffer.clone(), diff --git a/src/bin/server.rs b/src/bin/server.rs index 48a4f27..9476b59 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs @@ -22,6 +22,8 @@ struct Server { } fn main() { + let version = env!("CARGO_PKG_VERSION"); + println!("Running clichess version {}", version); let chess = Arc::new(Mutex::new(Chess::default())); let players = Arc::new(Mutex::new(HashMap::new())); let mut counter = 0;