aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src/input.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-10 16:46:21 +0000
committerGitHub <[email protected]>2020-03-10 16:46:21 +0000
commit6b9d66bbee865bd4337366f1540f8e5aa8d82c18 (patch)
tree8a7e50f9cef97fcadcd3832ff196010e03177068 /crates/ra_db/src/input.rs
parent34bc0f4f55a9c2239d77b550b9bbd61b4eef6bb1 (diff)
parent95ba7da1abcd18b49c1a2dfc16c8d0e34c64ef45 (diff)
Merge #3536
3536: Add get and set for `Env` r=matklad a=edwin0cheng This PR add three things : 1. Add `get` and `set` in `Env`. 2. Implement fixture meta for `with_single_file`. 3. Add `env` meta in fixture. Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_db/src/input.rs')
-rw-r--r--crates/ra_db/src/input.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs
index b77640b2b..1a1c64202 100644
--- a/crates/ra_db/src/input.rs
+++ b/crates/ra_db/src/input.rs
@@ -261,6 +261,16 @@ impl fmt::Display for Edition {
261 } 261 }
262} 262}
263 263
264impl Env {
265 pub fn set(&mut self, env: &str, value: String) {
266 self.entries.insert(env.to_owned(), value);
267 }
268
269 pub fn get(&self, env: &str) -> Option<String> {
270 self.entries.get(env).cloned()
271 }
272}
273
264#[derive(Debug)] 274#[derive(Debug)]
265pub struct ParseEditionError { 275pub struct ParseEditionError {
266 invalid_input: String, 276 invalid_input: String,