PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
style: format checked soft-wrap budget assignment
FredApps25f3d12960f8
diff --git a/crates/edit/src/text/interp.rs b/crates/edit/src/text/interp.rsindex af9a51f0d..2b55e51ef 100644--- a/crates/edit/src/text/interp.rs+++ b/crates/edit/src/text/interp.rs@@ -810,10 +810,8 @@ pub(super) fn interpret(// The marker is untrusted and later expands into spaces during reflow.// Charge it to the same page-wide budget as glyph text, so many individually// small markers cannot multiply the allocation past the limit either.- carry.text_left = carry- .text_left- .checked_sub(soft_gap)- .ok_or_else(|| EditError::Invalid("the page's text is too large to read".into()))?;+ carry.text_left =+ carry.text_left.checked_sub(soft_gap).ok_or_else(|| EditError::Invalid("the page's text is too large to read".into()))?;} else if op.name(0) == Some(b"PCHard") {hard_break = true;soft_break = false;