diff options
| author | troido <troido@protonmail.com> | 2020-02-03 20:38:51 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-03 20:38:51 +0100 |
| commit | 4bfa58f1316a18466d40488e46a6d3c8023f9643 (patch) | |
| tree | cb4166743caa51cd83ccbd093619c2a84914022f /src/controls.rs | |
| parent | dc6ca50ce53d1a9a9ad475e4d82fb3b1fcdfae58 (diff) | |
don't crash on invalid actions
Diffstat (limited to 'src/controls.rs')
| -rw-r--r-- | src/controls.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/controls.rs b/src/controls.rs index 101b401..1f96180 100644 --- a/src/controls.rs +++ b/src/controls.rs @@ -47,7 +47,7 @@ pub enum Control { impl Control { - pub fn from_json(val: Value) -> Option<Control>{ + pub fn from_json(val: &Value) -> Option<Control>{ if let Value::String(control_type) = &val[0] { match control_type.as_str() { "move" => match Direction::from_json(&val[1]) { |
