Handle digraph casing
This commit is contained in:
@@ -50,10 +50,10 @@ fn to_runic(latin: String) -> String {
|
|||||||
let mut chars = latin.chars().peekable();
|
let mut chars = latin.chars().peekable();
|
||||||
let mut out = String::with_capacity(latin.len());
|
let mut out = String::with_capacity(latin.len());
|
||||||
while let Some(c) = chars.next() {
|
while let Some(c) = chars.next() {
|
||||||
if let Some(digraphs) = DIGRAPHS.get(&c) {
|
if let Some(digraphs) = DIGRAPHS.get(&c.to_ascii_lowercase()) {
|
||||||
if let Some((_, rune)) = digraphs.iter().find(|(second, _)| match chars.peek() {
|
if let Some((_, rune)) = digraphs.iter().find(|(second, _)| match chars.peek() {
|
||||||
Some(peeked) => second == peeked, // unstable: chars.peek().contains(&second)
|
Some(peeked) => second == &peeked.to_ascii_lowercase(),
|
||||||
None => false,
|
None => false, // unstable: chars.peek().contains(&second.to_ascii_lowercase())
|
||||||
}) {
|
}) {
|
||||||
chars.next();
|
chars.next();
|
||||||
out.push(*rune);
|
out.push(*rune);
|
||||||
|
|||||||
Reference in New Issue
Block a user