aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src/fixture.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-12 15:30:36 +0000
committerGitHub <[email protected]>2019-11-12 15:30:36 +0000
commit2549be750e4c611a582bc0845b1da71e131f1118 (patch)
treefec19f32a3b9dd7ced95281b291674ed7ee3a4cd /crates/ra_db/src/fixture.rs
parent55f3ff241a2105d2903266703474acbd24a85e84 (diff)
parentdae087656abf5d120cd9c051bf4fc446fca101e1 (diff)
Merge #2217
2217: Implement FromStr for enum Edition r=matklad a=clemarescx Just did this as I came across the comment in the code asking for implementing `std::str::FromStr` for `input::Edition`. Not sure what was meant by "proper error handling" though, `panic!` with a descriptive message might not be it :sweat_smile: Co-authored-by: Metabaron <[email protected]>
Diffstat (limited to 'crates/ra_db/src/fixture.rs')
-rw-r--r--crates/ra_db/src/fixture.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs
index f5dd59f84..ee883b615 100644
--- a/crates/ra_db/src/fixture.rs
+++ b/crates/ra_db/src/fixture.rs
@@ -1,5 +1,6 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use std::str::FromStr;
3use std::sync::Arc; 4use std::sync::Arc;
4 5
5use ra_cfg::CfgOptions; 6use ra_cfg::CfgOptions;
@@ -164,7 +165,7 @@ fn parse_meta(meta: &str) -> ParsedMeta {
164 match key { 165 match key {
165 "crate" => krate = Some(value.to_string()), 166 "crate" => krate = Some(value.to_string()),
166 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(), 167 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
167 "edition" => edition = Edition::from_string(&value), 168 "edition" => edition = Edition::from_str(&value).unwrap(),
168 "cfg" => { 169 "cfg" => {
169 for key in value.split(',') { 170 for key in value.split(',') {
170 match split1(key, '=') { 171 match split1(key, '=') {