From b893bec4bbdfda549a1c45bd5328b3dd78a2e05c Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 6 Mar 2011 13:00:52 -0500 Subject: [PATCH] Flatten conditionals in rustc.rs. Remove FIXME --- src/comp/driver/rustc.rs | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 69e61aa0494..67275b9b76b 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -113,24 +113,19 @@ fn get_os() -> session.os { do_warn = false; } else if (_str.eq(arg, "-shared")) { shared = true; - } else { - // FIXME: rust could use an elif construct. - if (_str.eq(arg, "-o")) { - if (i+1u < len) { - output_file = some(args.(i+1u)); - i += 1u; - } else { - usage(sess, args.(0)); - sess.err("-o requires an argument"); - } + } else if (_str.eq(arg, "-o")) { + if (i+1u < len) { + output_file = some(args.(i+1u)); + i += 1u; } else { - if (_str.eq(arg, "-h")) { - usage(sess, args.(0)); - } else { - usage(sess, args.(0)); - sess.err("unrecognized option: " + arg); - } + usage(sess, args.(0)); + sess.err("-o requires an argument"); } + } else if (_str.eq(arg, "-h")) { + usage(sess, args.(0)); + } else { + usage(sess, args.(0)); + sess.err("unrecognized option: " + arg); } } else { alt (input_file) {