mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Use more elegant saturating_sub
This commit is contained in:
parent
d2f2f642c1
commit
b021458352
@ -99,11 +99,8 @@ impl<'a> Iterator for LinesIterator<'a> {
|
||||
let content = &content[..next];
|
||||
|
||||
let allowed_width = if self.show_spaces {
|
||||
if self.width < 1 {
|
||||
0
|
||||
} else {
|
||||
self.width - 1
|
||||
}
|
||||
// Remove 1 from the available space, if possible.
|
||||
self.width.saturating_sub(1)
|
||||
} else {
|
||||
self.width
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user