From 2494b370709af7b4dfbd4f3a4abdf1952d71fbe7 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Fri, 24 Jan 2020 13:25:03 -0800 Subject: [PATCH] build fixes --- src/bridge/events.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bridge/events.rs b/src/bridge/events.rs index bbad6be..15fd229 100644 --- a/src/bridge/events.rs +++ b/src/bridge/events.rs @@ -426,13 +426,13 @@ fn parse_win_pos(win_pos_arguments: Vec) -> Result { } } -fn parse_window_anchor(anchor: Value) -> Result { - match parse_string(&anchor) { - Ok("NW") => Ok(WindowAnchor::NorthWest), - Ok("NE") => Ok(WindowAnchor::NorthEast), - Ok("SW") => Ok(WindowAnchor::SouthWest), - Ok("SE") => Ok(WindowAnchor::SouthEast), - _ => Err(InvalidWindowAnchor(value)) +fn parse_window_anchor(value: &Value) -> Result { + match parse_string(value).ok().as_deref() { + Some("NW") => Ok(WindowAnchor::NorthWest), + Some("NE") => Ok(WindowAnchor::NorthEast), + Some("SW") => Ok(WindowAnchor::SouthWest), + Some("SE") => Ok(WindowAnchor::SouthEast), + _ => Err(EventParseError::InvalidWindowAnchor(value.clone())) } }