macro_rules! assert_eq_pnsat {
($lhs:expr, $rhs:expr) => {
assert_eq!(
- pns($lhs).and_then(|(s, _)| s.translate()),
+ pns($lhs).and_then(|(s, _)| s.translate().ok()),
$rhs.map(<String as From<&str>>::from)
)
};
#[test]
fn test_iter() {
let s = "The %d'th word %% is: `%.*s` %!\n";
- let subs: Vec<_> = iter_subs(s, 0).map(|sub| sub.translate()).collect();
+ let subs: Vec<_> = iter_subs(s, 0).map(|sub| sub.translate().ok()).collect();
assert_eq!(
subs.iter().map(|ms| ms.as_ref().map(|s| &s[..])).collect::<Vec<_>>(),
vec![Some("{}"), None, Some("{:.*}"), None]