mirror of
https://gitee.com/openharmony/third_party_rust_unicode-ident
synced 2024-11-23 07:29:52 +00:00
Improve table generator failure messages
This commit is contained in:
parent
d9fd2ffe77
commit
3f1a9570b5
@ -54,7 +54,10 @@ fn main() {
|
|||||||
*prev
|
*prev
|
||||||
} else {
|
} else {
|
||||||
dense.push(chunk);
|
dense.push(chunk);
|
||||||
let new = u8::try_from(chunkmap.len()).unwrap();
|
let new = match u8::try_from(chunkmap.len()) {
|
||||||
|
Ok(byte) => byte,
|
||||||
|
Err(_) => panic!("exceeded 256 unique chunks"),
|
||||||
|
};
|
||||||
chunkmap.insert(chunk, new);
|
chunkmap.insert(chunk, new);
|
||||||
new
|
new
|
||||||
}
|
}
|
||||||
@ -117,7 +120,10 @@ fn main() {
|
|||||||
back.copy_from_slice(&chunk[CHUNK / 2..]);
|
back.copy_from_slice(&chunk[CHUNK / 2..]);
|
||||||
dense_to_halfdense.insert(
|
dense_to_halfdense.insert(
|
||||||
original_pos,
|
original_pos,
|
||||||
u8::try_from(halfdense.len() / (CHUNK / 2)).unwrap(),
|
match u8::try_from(halfdense.len() / (CHUNK / 2)) {
|
||||||
|
Ok(byte) => byte,
|
||||||
|
Err(_) => panic!("exceeded 256 half-chunks"),
|
||||||
|
},
|
||||||
);
|
);
|
||||||
halfdense.extend_from_slice(&front);
|
halfdense.extend_from_slice(&front);
|
||||||
halfdense.extend_from_slice(&back);
|
halfdense.extend_from_slice(&back);
|
||||||
@ -134,7 +140,10 @@ fn main() {
|
|||||||
}
|
}
|
||||||
dense_to_halfdense.insert(
|
dense_to_halfdense.insert(
|
||||||
original_pos,
|
original_pos,
|
||||||
u8::try_from(halfdense.len() / (CHUNK / 2) - 1).unwrap(),
|
match u8::try_from(halfdense.len() / (CHUNK / 2) - 1) {
|
||||||
|
Ok(byte) => byte,
|
||||||
|
Err(_) => panic!("exceeded 256 half-chunks"),
|
||||||
|
},
|
||||||
);
|
);
|
||||||
halfdense.extend_from_slice(&next);
|
halfdense.extend_from_slice(&next);
|
||||||
back = next;
|
back = next;
|
||||||
|
Loading…
Reference in New Issue
Block a user