mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
format services/content-plugin-api
This commit is contained in:
parent
d38ad8a289
commit
05dd566976
1 changed files with 2 additions and 7 deletions
|
|
@ -10,6 +10,7 @@ pub enum Opcode {
|
||||||
|
|
||||||
impl core::convert::TryFrom<&Message> for Opcode {
|
impl core::convert::TryFrom<&Message> for Opcode {
|
||||||
type Error = &'static str;
|
type Error = &'static str;
|
||||||
|
|
||||||
fn try_from(message: &Message) -> Result<Self, Self::Error> {
|
fn try_from(message: &Message) -> Result<Self, Self::Error> {
|
||||||
match message {
|
match message {
|
||||||
Message::Scalar(m) => match m.id {
|
Message::Scalar(m) => match m.id {
|
||||||
|
|
@ -24,13 +25,7 @@ impl core::convert::TryFrom<&Message> for Opcode {
|
||||||
impl From<Opcode> for Message {
|
impl From<Opcode> for Message {
|
||||||
fn from(opcode: Opcode) -> Message {
|
fn from(opcode: Opcode) -> Message {
|
||||||
match opcode {
|
match opcode {
|
||||||
Opcode::Redraw => Message::Scalar(ScalarMessage {
|
Opcode::Redraw => Message::Scalar(ScalarMessage { id: 0, arg1: 0, arg2: 0, arg3: 0, arg4: 0 }),
|
||||||
id: 0,
|
|
||||||
arg1: 0,
|
|
||||||
arg2: 0,
|
|
||||||
arg3: 0,
|
|
||||||
arg4: 0,
|
|
||||||
}),
|
|
||||||
// _ => panic!("SHCH api: Opcode type not handled by From<Opcode>, refer to helper method"),
|
// _ => panic!("SHCH api: Opcode type not handled by From<Opcode>, refer to helper method"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue