Skip to content

Commit b893bec

Browse files
brsongraydon
authored andcommitted
Flatten conditionals in rustc.rs. Remove FIXME
1 parent bed457d commit b893bec

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

src/comp/driver/rustc.rs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,24 +113,19 @@ impure fn main(vec[str] args) {
113113
do_warn = false;
114114
} else if (_str.eq(arg, "-shared")) {
115115
shared = true;
116-
} else {
117-
// FIXME: rust could use an elif construct.
118-
if (_str.eq(arg, "-o")) {
119-
if (i+1u < len) {
120-
output_file = some(args.(i+1u));
121-
i += 1u;
122-
} else {
123-
usage(sess, args.(0));
124-
sess.err("-o requires an argument");
125-
}
116+
} else if (_str.eq(arg, "-o")) {
117+
if (i+1u < len) {
118+
output_file = some(args.(i+1u));
119+
i += 1u;
126120
} else {
127-
if (_str.eq(arg, "-h")) {
128-
usage(sess, args.(0));
129-
} else {
130-
usage(sess, args.(0));
131-
sess.err("unrecognized option: " + arg);
132-
}
121+
usage(sess, args.(0));
122+
sess.err("-o requires an argument");
133123
}
124+
} else if (_str.eq(arg, "-h")) {
125+
usage(sess, args.(0));
126+
} else {
127+
usage(sess, args.(0));
128+
sess.err("unrecognized option: " + arg);
134129
}
135130
} else {
136131
alt (input_file) {

0 commit comments

Comments
 (0)