Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/base-db/src/input.rs')
| -rw-r--r-- | crates/base-db/src/input.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/base-db/src/input.rs b/crates/base-db/src/input.rs index 6a8ab71624..e136d8e915 100644 --- a/crates/base-db/src/input.rs +++ b/crates/base-db/src/input.rs @@ -331,10 +331,11 @@ impl CrateGraph { version: Option<String>, cfg_options: Arc<CfgOptions>, potential_cfg_options: Option<Arc<CfgOptions>>, - env: Env, + mut env: Env, is_proc_macro: bool, origin: CrateOrigin, ) -> CrateId { + env.entries.shrink_to_fit(); let data = CrateData { root_file_id, edition, @@ -651,8 +652,8 @@ impl FromIterator<(String, String)> for Env { } impl Env { - pub fn set(&mut self, env: &str, value: String) { - self.entries.insert(env.to_owned(), value); + pub fn set(&mut self, env: &str, value: impl Into<String>) { + self.entries.insert(env.to_owned(), value.into()); } pub fn get(&self, env: &str) -> Option<String> { |