// When rewriting chain, veto going multi line except the last element
pub force_one_line_chain: RefCell<bool>,
pub snippet_provider: &'a SnippetProvider<'a>,
- pub report: FormatReport,
+ // Used for `format_snippet`
+ pub(crate) macro_rewrite_failure: RefCell<bool>,
+ pub(crate) report: FormatReport,
}
impl<'a> RewriteContext<'a> {
}
pub fn budget(&self, used_width: usize) -> usize {
- self.config.max_width().checked_sub(used_width).unwrap_or(0)
+ self.config.max_width().saturating_sub(used_width)
}
pub fn inside_macro(&self) -> bool {