mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
1b1d7166a1
We may go back to an enum though, to handle text views in LinearLayouts. But the previous Fixed/AtMost/Unknown distinction was useless.
17 lines
287 B
Rust
17 lines
287 B
Rust
|
|
/*
|
|
/// Integer division that rounds up.
|
|
pub fn div_up_usize(p: usize, q: usize) -> usize {
|
|
div_up(p as u32, q as u32) as usize
|
|
}
|
|
|
|
/// Integer division that rounds up.
|
|
pub fn div_up(p: u32, q: u32) -> u32 {
|
|
if p % q == 0 {
|
|
p / q
|
|
} else {
|
|
1 + p / q
|
|
}
|
|
}
|
|
*/
|