Bug 1487995: webdriver: avoid redundant mapping closure; r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Sat, 01 Sep 2018 15:23:41 +0100
changeset 492245 70b142cc123a637c01f92a9a13683d43f017373a
parent 492244 c91d997687bf454984288ff865e05aa6a4e680ea
child 492246 a7f1cad8ce399ed3a0018e454cb938b91a39388f
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1487995
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1487995: webdriver: avoid redundant mapping closure; r=whimboo The deserialised value is already Some({u,i}64).
testing/webdriver/src/actions.rs
--- a/testing/webdriver/src/actions.rs
+++ b/testing/webdriver/src/actions.rs
@@ -199,26 +199,24 @@ where
 }
 
 fn deserialize_to_option_i64<'de, D>(deserializer: D) -> Result<Option<i64>, D::Error>
 where
     D: Deserializer<'de>,
 {
     Option::deserialize(deserializer)?
         .ok_or_else(|| de::Error::custom("invalid type: null, expected i64"))
-        .map(|v: i64| Some(v))
 }
 
 fn deserialize_to_option_u64<'de, D>(deserializer: D) -> Result<Option<u64>, D::Error>
 where
     D: Deserializer<'de>,
 {
     Option::deserialize(deserializer)?
         .ok_or_else(|| de::Error::custom("invalid type: null, expected i64"))
-        .map(|v: u64| Some(v))
 }
 
 #[cfg(test)]
 mod test {
     use super::*;
     use serde_json;
     use test::{check_deserialize, check_serialize_deserialize};