Implement FromStr for RelroLevel rather than duplicating the match

Signed-off-by: Johannes Löthberg <[email protected]>
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index a5fa6c8..5661c41 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -790,9 +790,12 @@
 
         fn parse_relro_level(slot: &mut Option<RelroLevel>, v: Option<&str>) -> bool {
             match v {
-                Some("full") => *slot = Some(RelroLevel::Full),
-                Some("partial") => *slot = Some(RelroLevel::Partial),
-                Some("off") => *slot = Some(RelroLevel::Off),
+                Some(s) => {
+                    match s.parse::<RelroLevel>() {
+                        Ok(level) => *slot = Some(level),
+                        _ => return false
+                    }
+                },
                 _ => return false
             }
             true