Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub enum Format<'a> {
/// Custom indenters are passed the current line number and the buffer to be written to as args
Custom {
/// The custom indenter
inserter: &'a mut Inserter,
inserter: &'a mut Inserter<'a>,
},
}

Expand All @@ -162,7 +162,7 @@ pub struct Indented<'a, D: ?Sized> {
/// A callback for `Format::Custom` used to insert indenation after a new line
///
/// The first argument is the line number within the output, starting from 0
pub type Inserter = dyn FnMut(usize, &mut dyn fmt::Write) -> fmt::Result;
pub type Inserter<'a> = dyn FnMut(usize, &mut dyn fmt::Write) -> fmt::Result + 'a;

impl Format<'_> {
fn insert_indentation(&mut self, line: usize, f: &mut dyn fmt::Write) -> fmt::Result {
Expand Down