Added crate feature (for real this time)

This commit is contained in:
famfo 2021-11-12 22:19:35 +01:00 committed by Yash Karandikar
parent 8fc908a38e
commit 9dbac49bc4
Signed by: karx
GPG key ID: A794DA2529474BA5
3 changed files with 8 additions and 0 deletions

View file

@ -23,4 +23,5 @@ optional = true
[features]
default = ["tls"]
tls = ["native-tls"]
debug = []

View file

@ -181,6 +181,10 @@ impl Command {
/// Performs the conversion
pub fn from_str(s: &str) -> Self {
let new = s.trim();
#[cfg(feature = "debug")]
print!("{}", new);
let parts: Vec<&str> = new.split_whitespace().collect();
if parts[0] == "PING" {

View file

@ -188,6 +188,9 @@ impl Client {
Cow::Owned(new) as Cow<str>
};
#[cfg(feature = "debug")]
println!("{:?}", formatted);
self.stream.write(formatted.as_bytes())?;
Ok(())