Skip to content

Commit 4d76b96

Browse files
committed
Remove unnecessary unwrap in recompose
1 parent 74dddd6 commit 4d76b96

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/recompose.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ impl<I: Iterator<Item=char>> Iterator for Recompositions<I> {
6363
Composing => {
6464
for ch in self.iter.by_ref() {
6565
let ch_class = super::char::canonical_combining_class(ch);
66-
if self.composee.is_none() {
67-
if ch_class != 0 {
68-
return Some(ch);
69-
}
70-
self.composee = Some(ch);
71-
continue;
72-
}
73-
let k = self.composee.clone().unwrap();
74-
66+
let k = match self.composee {
67+
None => {
68+
if ch_class != 0 {
69+
return Some(ch);
70+
}
71+
self.composee = Some(ch);
72+
continue;
73+
},
74+
Some(k) => k,
75+
};
7576
match self.last_ccc {
7677
None => {
7778
match super::char::compose(k, ch) {

0 commit comments

Comments
 (0)