Added crate feature (for real this time)
This commit is contained in:
parent
8fc908a38e
commit
9dbac49bc4
|
@ -23,4 +23,5 @@ optional = true
|
||||||
[features]
|
[features]
|
||||||
default = ["tls"]
|
default = ["tls"]
|
||||||
tls = ["native-tls"]
|
tls = ["native-tls"]
|
||||||
|
debug = []
|
||||||
|
|
||||||
|
|
|
@ -181,6 +181,10 @@ impl Command {
|
||||||
/// Performs the conversion
|
/// Performs the conversion
|
||||||
pub fn from_str(s: &str) -> Self {
|
pub fn from_str(s: &str) -> Self {
|
||||||
let new = s.trim();
|
let new = s.trim();
|
||||||
|
|
||||||
|
#[cfg(feature = "debug")]
|
||||||
|
print!("{}", new);
|
||||||
|
|
||||||
let parts: Vec<&str> = new.split_whitespace().collect();
|
let parts: Vec<&str> = new.split_whitespace().collect();
|
||||||
|
|
||||||
if parts[0] == "PING" {
|
if parts[0] == "PING" {
|
||||||
|
|
|
@ -188,6 +188,9 @@ impl Client {
|
||||||
Cow::Owned(new) as Cow<str>
|
Cow::Owned(new) as Cow<str>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(feature = "debug")]
|
||||||
|
println!("{:?}", formatted);
|
||||||
|
|
||||||
self.stream.write(formatted.as_bytes())?;
|
self.stream.write(formatted.as_bytes())?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue