We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 939bca0 commit 2f7ed33Copy full SHA for 2f7ed33
src/test/compiletest/compiletest.rs
@@ -533,8 +533,27 @@ mod runtest {
533
}
534
535
fn split_maybe_args(argstr: &option::t[str]) -> vec[str] {
536
+ fn rm_whitespace(v: vec[str]) -> vec[str] {
537
+ fn flt(s: &str) -> option::t[str] {
538
+ if !is_whitespace(s) {
539
+ option::some(s)
540
+ } else {
541
+ option::none
542
+ }
543
544
+
545
+ // FIXME: This should be in std
546
+ fn is_whitespace(s: str) -> bool {
547
+ for c: u8 in s {
548
+ if c != (' ' as u8) { ret false; }
549
550
+ ret true;
551
552
+ vec::filter_map(flt, v)
553
554
555
alt argstr {
- option::some(s) { str::split(s, ' ' as u8) }
556
+ option::some(s) { rm_whitespace(str::split(s, ' ' as u8)) }
557
option::none. { [] }
558
559
0 commit comments