Skip to content

Commit

Permalink
Add lifetime to Section references
Browse files Browse the repository at this point in the history
  • Loading branch information
crzysdrs committed Mar 8, 2024
1 parent 9c581bf commit 869846d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/write/section.rs
Expand Up @@ -121,9 +121,9 @@ impl<W: Writer + Clone> Sections<W> {

impl<W: Writer> Sections<W> {
/// For each section, call `f` once with a shared reference.
pub fn for_each<F, E>(&self, mut f: F) -> result::Result<(), E>
pub fn for_each<'a, F, E>(&'a self, mut f: F) -> result::Result<(), E>
where
F: FnMut(SectionId, &W) -> result::Result<(), E>,
F: FnMut(SectionId, &'a W) -> result::Result<(), E>,
{
macro_rules! f {
($s:expr) => {
Expand All @@ -146,9 +146,9 @@ impl<W: Writer> Sections<W> {
}

/// For each section, call `f` once with a mutable reference.
pub fn for_each_mut<F, E>(&mut self, mut f: F) -> result::Result<(), E>
pub fn for_each_mut<'a, F, E>(&'a mut self, mut f: F) -> result::Result<(), E>
where
F: FnMut(SectionId, &mut W) -> result::Result<(), E>,
F: FnMut(SectionId, &'a mut W) -> result::Result<(), E>,
{
macro_rules! f {
($s:expr) => {
Expand Down

0 comments on commit 869846d

Please sign in to comment.