services/content-plugin-api: Implement From instead of Into

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
This commit is contained in:
Jean-Pierre De Jesus DIAZ 2022-10-12 15:30:50 +02:00
parent d651ce51cc
commit 0316cd2a3a
No known key found for this signature in database
GPG key ID: 6279AEC20A9524EC

View file

@ -21,9 +21,9 @@ impl core::convert::TryFrom<&Message> for Opcode {
} }
} }
impl Into<Message> for Opcode { impl From<Opcode> for Message {
fn into(self) -> Message { fn from(opcode: Opcode) -> Message {
match self { match opcode {
Opcode::Redraw => Message::Scalar(ScalarMessage { Opcode::Redraw => Message::Scalar(ScalarMessage {
id: 0, id: 0,
arg1: 0, arg1: 0,
@ -31,7 +31,7 @@ impl Into<Message> for Opcode {
arg3: 0, arg3: 0,
arg4: 0, arg4: 0,
}), }),
// _ => panic!("SHCH api: Opcode type not handled by Into(), refer to helper method"), // _ => panic!("SHCH api: Opcode type not handled by From<Opcode>, refer to helper method"),
} }
} }
} }