rust/tests/ui/issues/issue-4541.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
376 B
Rust
Raw Normal View History

// run-pass
fn parse_args() -> String {
let args: Vec<_> = ::std::env::args().collect();
2013-01-29 19:44:46 +00:00
let mut n = 0;
while n < args.len() {
match &*args[n] {
"-v" => (),
2013-01-29 19:44:46 +00:00
s => {
return s.to_string();
2013-01-29 19:44:46 +00:00
}
}
n += 1;
}
return "".to_string()
2013-01-29 19:44:46 +00:00
}
pub fn main() {
println!("{}", parse_args());
2013-01-29 19:44:46 +00:00
}