Use env instead of hardcoding version

This commit is contained in:
Yash Karandikar 2021-11-07 21:10:19 -06:00
parent ef57dc3ba3
commit 162d5a42d0
2 changed files with 4 additions and 4 deletions

View file

@ -114,7 +114,7 @@ pub enum Command {
/// Message /// Message
String, String,
), ),
/// Leaves the IRC and shuts down the TCP stream /// Leaves the IRC
/// ```no_run /// ```no_run
/// # use circe::* /// # use circe::*
/// # let mut client = Client::new(Config::from_toml("config.toml")?)?; /// # let mut client = Client::new(Config::from_toml("config.toml")?)?;
@ -448,7 +448,7 @@ impl Client {
self.write_command(Command::QUIT(message.to_string()))?; self.write_command(Command::QUIT(message.to_string()))?;
} else { } else {
self.write_command(Command::QUIT( self.write_command(Command::QUIT(
"circe 0.1.2 (https://crates.io/crates/circe)".to_string(), format!("circe {} (https://crates.io/crates/circe)", env!("CARGO_PKG_VERSION")),
))?; ))?;
} }
self.stream.shutdown(std::net::Shutdown::Both)?; self.stream.shutdown(std::net::Shutdown::Both)?;

View file

@ -12,8 +12,8 @@ macro_rules! loop_n {
fn main() -> Result<(), std::io::Error> { fn main() -> Result<(), std::io::Error> {
//let config = Config::from_toml("config.toml")?; //let config = Config::from_toml("config.toml")?;
let config = Config::new( let config = Config::new(
vec!["#main", "#circe"], vec!["#main", "#no-normies"],
"192.168.178.100", "192.168.1.28",
Some("+B"), Some("+B"),
Some("circe"), Some("circe"),
6667, 6667,