added from vector trait to commands

This commit is contained in:
michael-bailey 2021-03-16 10:11:03 +00:00
parent 9b5cb18693
commit 5b7258d3ab
1 changed files with 8 additions and 0 deletions

View File

@ -230,6 +230,14 @@ impl From<&mut [u8; 1024]> for Commands {
}
}
impl From<&mut Vec<u8>> for Commands {
fn from(data: &mut Vec<u8>) -> Self {
let incoming_message = String::from(String::from_utf8_lossy(data));
data.zeroize();
Commands::from(incoming_message)
}
}
// TODO: check if unit tests still work
/*#[cfg(test)]
mod test_commands_v2 {