diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f6ca4d..e659534 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.87.0 + - uses: dtolnay/rust-toolchain@1.89.0 - run: cargo build - run: cargo test @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.87.0 + - uses: dtolnay/rust-toolchain@1.89.0 with: components: clippy, rustfmt - uses: Swatinem/rust-cache@v2 diff --git a/src/chunk.rs b/src/chunk.rs index 6224431..d23c390 100644 --- a/src/chunk.rs +++ b/src/chunk.rs @@ -222,7 +222,9 @@ impl ChunksExt for [Spanned] { /// An iterator over the characters in each chunk, indicating whether they are /// verbatim or not. Chunk types other than `Normal` or `Verbatim` are omitted. -pub(crate) fn chunk_chars(chunks: ChunksRef) -> impl Iterator + '_ { +pub(crate) fn chunk_chars( + chunks: ChunksRef<'_>, +) -> impl Iterator + '_ { chunks.iter().flat_map(|chunk| { let (s, verbatim) = chunk.v.get_and_verb(); diff --git a/src/lib.rs b/src/lib.rs index 03d82aa..4c12ab4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -233,12 +233,12 @@ impl Bibliography { } /// An iterator over the bibliography's entries. - pub fn iter(&self) -> std::slice::Iter { + pub fn iter(&'_ self) -> std::slice::Iter<'_, Entry> { self.entries.iter() } /// A mutable iterator over the bibliography's entries. - pub fn iter_mut(&mut self) -> std::slice::IterMut { + pub fn iter_mut(&'_ mut self) -> std::slice::IterMut<'_, Entry> { self.entries.iter_mut() } @@ -311,7 +311,7 @@ impl Entry { /// Get the chunk slice of a field. /// /// The field key must be lowercase. - pub fn get(&self, key: &str) -> Option { + pub fn get(&'_ self, key: &str) -> Option> { self.fields.get(key).map(AsRef::as_ref) } @@ -588,7 +588,7 @@ impl Entry { } /// Get an entry but return None for empty chunk slices. - fn get_non_empty(&self, key: &str) -> Option { + fn get_non_empty(&'_ self, key: &str) -> Option> { let entry = self.get(key)?; if !entry.is_empty() { Some(entry) diff --git a/src/macros.rs b/src/macros.rs index 17336a3..22768f4 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -13,7 +13,7 @@ macro_rules! fields { })* }; - (@ret) => {ChunksRef}; + (@ret) => {ChunksRef<'_>}; (@ret $ret:ty) => {$ret}; (@set $name:ident => $field:literal, ) => {