Skip to content

Commit ba2bece

Browse files
authored
Merge pull request #87 from Atul9/cargo-fmt
Format code using 'cargo fmt'
2 parents 7321518 + beabfbb commit ba2bece

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

src/lib.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ impl Options {
354354
.to_str()
355355
.ok_or_else(|| Fail::UnrecognizedOption(format!("{:?}", i.as_ref())))
356356
.map(|s| s.to_owned())
357-
}).collect::<::std::result::Result<Vec<_>, _>>()?;
357+
})
358+
.collect::<::std::result::Result<Vec<_>, _>>()?;
358359
let mut args = args.into_iter().peekable();
359360
let mut arg_pos = 0;
360361
while let Some(cur) = args.next() {
@@ -839,7 +840,8 @@ impl Matches {
839840
.filter_map(|nm| match self.opt_val(&nm) {
840841
Some(Val(s)) => Some(s),
841842
_ => None,
842-
}).next()
843+
})
844+
.next()
843845
}
844846

845847
/// Returns a vector of the arguments provided to all matches of the given
@@ -852,7 +854,8 @@ impl Matches {
852854
.filter_map(|(_, v)| match v {
853855
Val(s) => Some(s),
854856
_ => None,
855-
}).collect()
857+
})
858+
.collect()
856859
}
857860

858861
/// Returns a vector of the arguments provided to all matches of the given
@@ -865,7 +868,8 @@ impl Matches {
865868
.filter_map(|(p, v)| match v {
866869
Val(s) => Some((p, s)),
867870
_ => None,
868-
}).collect()
871+
})
872+
.collect()
869873
}
870874

871875
/// Returns the string argument supplied to a matching option or `None`.
@@ -1013,7 +1017,8 @@ fn each_split_within(desc: &str, lim: usize) -> Vec<String> {
10131017
else {
10141018
(words, a, idx)
10151019
}
1016-
}).0;
1020+
})
1021+
.0;
10171022

10181023
let mut row = String::new();
10191024
for word in words.iter() {

src/tests/mod.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -1232,9 +1232,23 @@ fn test_opt_strs_pos() {
12321232
};
12331233

12341234
let a_pos = matches.opt_strs_pos("a");
1235-
assert_eq!(a_pos, vec![(0, "1".to_string()), (1, "2".to_string()), (3, "4".to_string())]);
1235+
assert_eq!(
1236+
a_pos,
1237+
vec![
1238+
(0, "1".to_string()),
1239+
(1, "2".to_string()),
1240+
(3, "4".to_string())
1241+
]
1242+
);
12361243
let e_pos = matches.opt_strs_pos("e");
12371244
assert_eq!(e_pos, vec![]);
12381245
let r_pos = matches.opt_strs_pos("r");
1239-
assert_eq!(r_pos, vec![(2, "3".to_string()), (4, "5".to_string()), (5, "6".to_string())]);
1246+
assert_eq!(
1247+
r_pos,
1248+
vec![
1249+
(2, "3".to_string()),
1250+
(4, "5".to_string()),
1251+
(5, "6".to_string())
1252+
]
1253+
);
12401254
}

0 commit comments

Comments
 (0)