Mercurial > lbo > hg > rex
changeset 40:b940909c52ec
repr: Fix tests and small, but important bug in concat_chars_to_str
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Mon, 21 Aug 2017 20:31:26 +0200 |
parents | b28753015c0b |
children | 89dbd4e17f9e |
files | src/repr.rs |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/repr.rs Mon Aug 21 20:28:03 2017 +0200 +++ b/src/repr.rs Mon Aug 21 20:31:26 2017 +0200 @@ -360,7 +360,7 @@ } if chars.len() == 1 { - return Pattern::Char(chars[0]); + new_elems.push(Pattern::Char(chars[0])); } else if chars.len() > 1 { let newp = Pattern::Str(String::from_iter(chars.drain(..))); new_elems.push(newp); @@ -418,7 +418,7 @@ Pattern::Str("cd".to_string())])); let case3 = (Pattern::Concat(vec![Pattern::Str("abc".to_string()), Pattern::Anchor(AnchorLocation::End), - Pattern::Str("d".to_string())]), + Pattern::Char('d')]), Pattern::Concat(vec![Pattern::Char('a'), Pattern::Char('b'), Pattern::Char('c'),