aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src/input.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-24 14:32:52 +0100
committerGitHub <[email protected]>2020-05-24 14:32:52 +0100
commitf26b7928e065f067d7181d3425fe17526dc3bcd1 (patch)
tree40dc4f23507c621ce80d0923a89c65faf947da2e /crates/ra_db/src/input.rs
parentce7144a93d6fe290731cd018da3052d948df4d57 (diff)
parentcd45c73b660f85acc9b564e536bc407f0836891d (diff)
Merge pull request #4495 from vsrs/fixture_meta
Test fixtures parsing improvements
Diffstat (limited to 'crates/ra_db/src/input.rs')
-rw-r--r--crates/ra_db/src/input.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs
index ab14e2d5e..4d2d3b48a 100644
--- a/crates/ra_db/src/input.rs
+++ b/crates/ra_db/src/input.rs
@@ -311,6 +311,21 @@ impl fmt::Display for Edition {
311 } 311 }
312} 312}
313 313
314impl<'a, T> From<T> for Env
315where
316 T: Iterator<Item = (&'a String, &'a String)>,
317{
318 fn from(iter: T) -> Self {
319 let mut result = Self::default();
320
321 for (k, v) in iter {
322 result.entries.insert(k.to_owned(), v.to_owned());
323 }
324
325 result
326 }
327}
328
314impl Env { 329impl Env {
315 pub fn set(&mut self, env: &str, value: String) { 330 pub fn set(&mut self, env: &str, value: String) {
316 self.entries.insert(env.to_owned(), value); 331 self.entries.insert(env.to_owned(), value);