mirror of
https://github.com/openharmony/third_party_rust_unicode-normalization.git
synced 2026-07-19 23:13:33 -04:00
Remove unnecessary unwrap in recompose
This commit is contained in:
+10
-9
@@ -63,15 +63,16 @@ impl<I: Iterator<Item=char>> Iterator for Recompositions<I> {
|
||||
Composing => {
|
||||
for ch in self.iter.by_ref() {
|
||||
let ch_class = super::char::canonical_combining_class(ch);
|
||||
if self.composee.is_none() {
|
||||
if ch_class != 0 {
|
||||
return Some(ch);
|
||||
}
|
||||
self.composee = Some(ch);
|
||||
continue;
|
||||
}
|
||||
let k = self.composee.clone().unwrap();
|
||||
|
||||
let k = match self.composee {
|
||||
None => {
|
||||
if ch_class != 0 {
|
||||
return Some(ch);
|
||||
}
|
||||
self.composee = Some(ch);
|
||||
continue;
|
||||
},
|
||||
Some(k) => k,
|
||||
};
|
||||
match self.last_ccc {
|
||||
None => {
|
||||
match super::char::compose(k, ch) {
|
||||
|
||||
Reference in New Issue
Block a user