diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-10-08 16:16:49 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-10-08 16:30:13 +0800 |
| commit | 292257a5f0997e24fb8e6e08b4dccdd439b81a97 (patch) | |
| tree | daa83b6578ff3f86944ea8b9eea15e670af70e11 /src | |
| parent | 3913ef83eb863661efd482194d83200dff609183 (diff) | |
format(image): make clippy happy
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/image.rs b/src/image.rs index ca84b1e..ce22b90 100644 --- a/src/image.rs +++ b/src/image.rs @@ -40,6 +40,12 @@ struct MutNCOffset<'a> { y: &'a mut u32, } +impl Default for FlowChart { + fn default() -> Self { + Self::new() + } +} + impl FlowChart { // TODO: based on how much text const COMPONENT_TEXT_PADDING: u32 = 1 * Self::RESOLUTION_MULTIPLIER; @@ -190,9 +196,7 @@ impl FlowChart { self.offset .center, ); - let mut cw = c - .checked_sub(w / 2) - .unwrap_or(0); + let mut cw = c.saturating_sub(w / 2); draw_filled_rect_mut(&mut self.img, Rect::at(cw as i32, curh as i32).of_size(w, h), colors::PROCESS); self.draw_text( &wrapped, |
