diff options
Diffstat (limited to 'crates/ra_db/src/input.rs')
-rw-r--r-- | crates/ra_db/src/input.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index aaa492759..6f2e5cfc7 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -6,7 +6,7 @@ | |||
6 | //! actual IO. See `vfs` and `project_model` in the `rust-analyzer` crate for how | 6 | //! actual IO. See `vfs` and `project_model` in the `rust-analyzer` crate for how |
7 | //! actual IO is done and lowered to input. | 7 | //! actual IO is done and lowered to input. |
8 | 8 | ||
9 | use std::{fmt, ops, str::FromStr, sync::Arc}; | 9 | use std::{fmt, iter::FromIterator, ops, str::FromStr, sync::Arc}; |
10 | 10 | ||
11 | use ra_cfg::CfgOptions; | 11 | use ra_cfg::CfgOptions; |
12 | use ra_syntax::SmolStr; | 12 | use ra_syntax::SmolStr; |
@@ -298,18 +298,9 @@ impl fmt::Display for Edition { | |||
298 | } | 298 | } |
299 | } | 299 | } |
300 | 300 | ||
301 | impl<'a, T> From<T> for Env | 301 | impl FromIterator<(String, String)> for Env { |
302 | where | 302 | fn from_iter<T: IntoIterator<Item = (String, String)>>(iter: T) -> Self { |
303 | T: Iterator<Item = (&'a String, &'a String)>, | 303 | Env { entries: FromIterator::from_iter(iter) } |
304 | { | ||
305 | fn from(iter: T) -> Self { | ||
306 | let mut result = Self::default(); | ||
307 | |||
308 | for (k, v) in iter { | ||
309 | result.entries.insert(k.to_owned(), v.to_owned()); | ||
310 | } | ||
311 | |||
312 | result | ||
313 | } | 304 | } |
314 | } | 305 | } |
315 | 306 | ||