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
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,24 @@ impl<'a, T: fmt::Write> CodeFormatter<'a, T> {
}
}

#[cfg(feature = "std")]
impl<'a, T> CodeFormatter<'a, T> {
/// Get a reference to the inner `T`
pub fn inner_ref(&self) -> &T {
self.f
}

/// Get a mutable reference to the inner `T`
pub fn inner_mut(&mut self) -> &mut T {
self.f
}

/// Get back the original mutable reference to the inner `T`
pub fn into_inner(self) -> &'a mut T {
self.f
}
}

#[cfg(test)]
mod tests {
extern crate alloc;
Expand Down