Update mod.rs
This commit is contained in:
parent
b62d32dcd5
commit
8981f5c551
|
|
@ -206,6 +206,13 @@ impl From<String> for Commands {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<&[u8]> for Commands {
|
||||
fn from(data: &[u8]) -> Self {
|
||||
let incoming_message = String::from(String::from_utf8_lossy(data)).as_str();
|
||||
Commands::from(incoming_message)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_commands_v2 {
|
||||
use super::Commands;
|
||||
|
|
|
|||
Loading…
Reference in New Issue