created new from imple for buffer
This commit is contained in:
parent
bd268d5a96
commit
6f660517da
|
|
@ -168,7 +168,7 @@ impl From<&str> for Commands {
|
|||
|
||||
for i in iter {
|
||||
let parameter = i.as_str().to_string();
|
||||
let mut parts:Vec<&str> = parameter.split(":").collect();
|
||||
let parts:Vec<&str> = parameter.split(":").collect();
|
||||
|
||||
map.insert(parts.index(0).to_string(), parts.index(1).to_string());
|
||||
}
|
||||
|
|
@ -201,6 +201,13 @@ impl From<String> for Commands {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<&[u8; 1024]> for Commands {
|
||||
fn from(data: &[u8; 1024]) -> Self {
|
||||
let incoming_message = String::from(String::from_utf8_lossy(data));
|
||||
Commands::from(incoming_message.as_str())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_commands_v2 {
|
||||
use super::Commands;
|
||||
|
|
|
|||
Loading…
Reference in New Issue