Bug 1577504 - Remove explicit lifetimes that can be elided r=jgraham
authorDavid Heiberg <dheiberg@mozilla.com>
Tue, 10 Sep 2019 15:02:15 +0000
changeset 492514 ed5978118f064f37f84a5bbf1a4c9c984519aad9
parent 492513 e52b51cf65699dccce7e0b7f25ba3863b36f6930
child 492515 abda0958db89df7fed0a30476de200a532373ba3
push id94958
push userjames@hoppipolla.co.uk
push dateTue, 10 Sep 2019 15:04:03 +0000
treeherderautoland@cc25750fd9e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1577504
milestone71.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 1577504 - Remove explicit lifetimes that can be elided r=jgraham When there is an input of either &self or &mut self, its lifetime is automatically assigned to the elided output lifetimes Depends on D45355 Differential Revision: https://phabricator.services.mozilla.com/D45356
testing/mozbase/rust/mozrunner/src/runner.rs
--- a/testing/mozbase/rust/mozrunner/src/runner.rs
+++ b/testing/mozbase/rust/mozrunner/src/runner.rs
@@ -13,41 +13,41 @@ use std::process::{Child, Command, Stdio
 use std::thread;
 use std::time;
 
 use crate::firefox_args::Arg;
 
 pub trait Runner {
     type Process;
 
-    fn arg<'a, S>(&'a mut self, arg: S) -> &'a mut Self
+    fn arg<S>(&mut self, arg: S) -> &mut Self
     where
         S: AsRef<OsStr>;
 
-    fn args<'a, I, S>(&'a mut self, args: I) -> &'a mut Self
+    fn args<I, S>(&mut self, args: I) -> &mut Self
     where
         I: IntoIterator<Item = S>,
         S: AsRef<OsStr>;
 
-    fn env<'a, K, V>(&'a mut self, key: K, value: V) -> &'a mut Self
+    fn env<K, V>(&mut self, key: K, value: V) -> &mut Self
     where
         K: AsRef<OsStr>,
         V: AsRef<OsStr>;
 
-    fn envs<'a, I, K, V>(&'a mut self, envs: I) -> &'a mut Self
+    fn envs<I, K, V>(&mut self, envs: I) -> &mut Self
     where
         I: IntoIterator<Item = (K, V)>,
         K: AsRef<OsStr>,
         V: AsRef<OsStr>;
 
-    fn stdout<'a, T>(&'a mut self, stdout: T) -> &'a mut Self
+    fn stdout<T>(&mut self, stdout: T) -> &mut Self
     where
         T: Into<Stdio>;
 
-    fn stderr<'a, T>(&'a mut self, stderr: T) -> &'a mut Self
+    fn stderr<T>(&mut self, stderr: T) -> &mut Self
     where
         T: Into<Stdio>;
 
     fn start(self) -> Result<Self::Process, RunnerError>;
 }
 
 pub trait RunnerProcess {
     /// Attempts to collect the exit status of the process if it has already exited.
@@ -193,65 +193,65 @@ impl FirefoxRunner {
             stderr: None,
         }
     }
 }
 
 impl Runner for FirefoxRunner {
     type Process = FirefoxProcess;
 
-    fn arg<'a, S>(&'a mut self, arg: S) -> &'a mut FirefoxRunner
+    fn arg<S>(&mut self, arg: S) -> &mut FirefoxRunner
     where
         S: AsRef<OsStr>,
     {
         self.args.push((&arg).into());
         self
     }
 
-    fn args<'a, I, S>(&'a mut self, args: I) -> &'a mut FirefoxRunner
+    fn args<I, S>(&mut self, args: I) -> &mut FirefoxRunner
     where
         I: IntoIterator<Item = S>,
         S: AsRef<OsStr>,
     {
         for arg in args {
             self.args.push((&arg).into());
         }
         self
     }
 
-    fn env<'a, K, V>(&'a mut self, key: K, value: V) -> &'a mut FirefoxRunner
+    fn env<K, V>(&mut self, key: K, value: V) -> &mut FirefoxRunner
     where
         K: AsRef<OsStr>,
         V: AsRef<OsStr>,
     {
         self.envs.insert((&key).into(), (&value).into());
         self
     }
 
-    fn envs<'a, I, K, V>(&'a mut self, envs: I) -> &'a mut FirefoxRunner
+    fn envs<I, K, V>(&mut self, envs: I) -> &mut FirefoxRunner
     where
         I: IntoIterator<Item = (K, V)>,
         K: AsRef<OsStr>,
         V: AsRef<OsStr>,
     {
         for (key, value) in envs {
             self.envs.insert((&key).into(), (&value).into());
         }
         self
     }
 
-    fn stdout<'a, T>(&'a mut self, stdout: T) -> &'a mut Self
+    fn stdout<T>(&mut self, stdout: T) -> &mut Self
     where
         T: Into<Stdio>,
     {
         self.stdout = Some(stdout.into());
         self
     }
 
-    fn stderr<'a, T>(&'a mut self, stderr: T) -> &'a mut Self
+    fn stderr<T>(&mut self, stderr: T) -> &mut Self
     where
         T: Into<Stdio>,
     {
         self.stderr = Some(stderr.into());
         self
     }
 
     fn start(mut self) -> Result<FirefoxProcess, RunnerError> {