aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_db/src')
-rw-r--r--crates/ra_db/src/fixture.rs2
-rw-r--r--crates/ra_db/src/input.rs17
2 files changed, 5 insertions, 14 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs
index 209713987..2aafb9965 100644
--- a/crates/ra_db/src/fixture.rs
+++ b/crates/ra_db/src/fixture.rs
@@ -222,7 +222,7 @@ impl From<Fixture> for FileMeta {
222 .edition 222 .edition
223 .as_ref() 223 .as_ref()
224 .map_or(Edition::Edition2018, |v| Edition::from_str(&v).unwrap()), 224 .map_or(Edition::Edition2018, |v| Edition::from_str(&v).unwrap()),
225 env: Env::from(f.env.iter()), 225 env: f.env.into_iter().collect(),
226 } 226 }
227 } 227 }
228} 228}
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
9use std::{fmt, ops, str::FromStr, sync::Arc}; 9use std::{fmt, iter::FromIterator, ops, str::FromStr, sync::Arc};
10 10
11use ra_cfg::CfgOptions; 11use ra_cfg::CfgOptions;
12use ra_syntax::SmolStr; 12use ra_syntax::SmolStr;
@@ -298,18 +298,9 @@ impl fmt::Display for Edition {
298 } 298 }
299} 299}
300 300
301impl<'a, T> From<T> for Env 301impl FromIterator<(String, String)> for Env {
302where 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