From 04ff39eb94cbf53dae2b4f4836a47750e36a02a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Mon, 2 Dec 2024 09:47:56 +0100 Subject: [PATCH] chore(release): bump to 0.14.3 (#443) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Minor readme improvments (#442) * chore: move the release process to its own file * chore: remove extra whitespace in rust code block * chore: better with a title :) ! * chore(book): add simple calculator example (#439) * chore(book): add simple calculator example * fix(book): footnote * Apply suggestions from code review Co-authored-by: Jérome Eertmans * Partially apply a suggestion from code review * fix(book): add clone instructions to the simple calculator example * chore(book): add the contributor info to the simple calculator example --------- Co-authored-by: ynn Co-authored-by: Jérome Eertmans * chore(release): bump version * chore(release): replace version in docs * chore(lint): apply Clippy and Rustfmt * chore(lint): allow needless lifetime --------- Co-authored-by: tk Co-authored-by: ynn <58146437+your-diary@users.noreply.github.com> Co-authored-by: ynn --- Cargo.toml | 4 ++-- book/src/getting-started.md | 2 +- logos-cli/Cargo.toml | 2 +- logos-codegen/src/generator/fork.rs | 2 +- logos-codegen/src/generator/leaf.rs | 2 +- logos-codegen/src/generator/rope.rs | 2 +- logos-codegen/src/graph/fork.rs | 2 +- logos-derive/Cargo.toml | 2 +- src/source.rs | 7 +++++-- tests/tests/source.rs | 5 ++++- 10 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1a8c1256..8b2104df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/maciejhirsz/logos" rust-version = "1.74.0" -version = "0.14.2" +version = "0.14.3" [package] name = "logos" @@ -67,7 +67,7 @@ bench = {lto = true} release = {lto = true} [dependencies] -logos-derive = {version = "0.14.2", path = "./logos-derive", optional = true} +logos-derive = {version = "0.14.3", path = "./logos-derive", optional = true} [dev-dependencies] ariadne = {version = "0.4", features = ["auto-color"]} diff --git a/book/src/getting-started.md b/book/src/getting-started.md index 18f54043..cc6bffed 100644 --- a/book/src/getting-started.md +++ b/book/src/getting-started.md @@ -4,7 +4,7 @@ ```toml [dependencies] -logos = "0.14.2" +logos = "0.14.3" ``` Then, you can automatically derive the [`Logos`](https://docs.rs/logos/latest/logos/trait.Logos.html) trait on your `enum` using the `Logos` derive macro: diff --git a/logos-cli/Cargo.toml b/logos-cli/Cargo.toml index 87d51652..adea815a 100644 --- a/logos-cli/Cargo.toml +++ b/logos-cli/Cargo.toml @@ -2,7 +2,7 @@ anyhow = "1.0.57" clap = {version = "3.1.18", features = ["derive"]} fs-err = "2.7.0" -logos-codegen = {version = "0.14.2", path = "../logos-codegen"} +logos-codegen = {version = "0.14.3", path = "../logos-codegen"} proc-macro2 = "1.0.39" [dev-dependencies] diff --git a/logos-codegen/src/generator/fork.rs b/logos-codegen/src/generator/fork.rs index 0f8eeec2..11d4eab2 100644 --- a/logos-codegen/src/generator/fork.rs +++ b/logos-codegen/src/generator/fork.rs @@ -10,7 +10,7 @@ use crate::util::ToIdent; type Targets = Map>; -impl<'a> Generator<'a> { +impl Generator<'_> { pub fn generate_fork(&mut self, this: NodeId, fork: &Fork, mut ctx: Context) -> TokenStream { let mut targets: Targets = Map::default(); diff --git a/logos-codegen/src/generator/leaf.rs b/logos-codegen/src/generator/leaf.rs index 04a6e983..0841a4ff 100644 --- a/logos-codegen/src/generator/leaf.rs +++ b/logos-codegen/src/generator/leaf.rs @@ -5,7 +5,7 @@ use crate::generator::{Context, Generator}; use crate::leaf::{Callback, Leaf}; use crate::util::MaybeVoid; -impl<'a> Generator<'a> { +impl Generator<'_> { pub fn generate_leaf(&mut self, leaf: &Leaf, mut ctx: Context) -> TokenStream { let bump = ctx.bump(); diff --git a/logos-codegen/src/generator/rope.rs b/logos-codegen/src/generator/rope.rs index 2c3e5dd2..ae3b07ad 100644 --- a/logos-codegen/src/generator/rope.rs +++ b/logos-codegen/src/generator/rope.rs @@ -4,7 +4,7 @@ use quote::quote; use crate::generator::{Context, Generator}; use crate::graph::Rope; -impl<'a> Generator<'a> { +impl Generator<'_> { pub fn generate_rope(&mut self, rope: &Rope, mut ctx: Context) -> TokenStream { let miss = ctx.miss(rope.miss.first(), self); let read = ctx.read(rope.pattern.len()); diff --git a/logos-codegen/src/graph/fork.rs b/logos-codegen/src/graph/fork.rs index 75142466..6b59836b 100644 --- a/logos-codegen/src/graph/fork.rs +++ b/logos-codegen/src/graph/fork.rs @@ -122,7 +122,7 @@ pub struct ForkIter<'a> { lut: &'a [Option; 256], } -impl<'a> Iterator for ForkIter<'a> { +impl Iterator for ForkIter<'_> { type Item = (Range, NodeId); fn next(&mut self) -> Option { diff --git a/logos-derive/Cargo.toml b/logos-derive/Cargo.toml index 873d9593..f3ad6ac4 100644 --- a/logos-derive/Cargo.toml +++ b/logos-derive/Cargo.toml @@ -1,5 +1,5 @@ [dependencies] -logos-codegen = {version = "0.14.2", path = "../logos-codegen"} +logos-codegen = {version = "0.14.3", path = "../logos-codegen"} [features] # Enables debug messages diff --git a/src/source.rs b/src/source.rs index 37e5c6a4..a3654410 100644 --- a/src/source.rs +++ b/src/source.rs @@ -241,8 +241,10 @@ where T: Deref, ::Target: Source, { - type Slice<'a> = ::Slice<'a> - where T: 'a; + type Slice<'a> + = ::Slice<'a> + where + T: 'a; fn len(&self) -> usize { self.deref().len() @@ -304,6 +306,7 @@ pub trait Chunk<'source>: Sized + Copy + PartialEq + Eq { fn from_slice(s: &'source [u8]) -> Option; } +#[allow(clippy::needless_lifetimes)] impl<'source> Chunk<'source> for u8 { const SIZE: usize = 1; diff --git a/tests/tests/source.rs b/tests/tests/source.rs index c31d2d28..58e77279 100644 --- a/tests/tests/source.rs +++ b/tests/tests/source.rs @@ -6,7 +6,10 @@ use logos_derive::Logos; struct RefSource<'s, S: ?Sized + Source>(&'s S); impl<'s, S: ?Sized + Source> Source for RefSource<'s, S> { - type Slice<'a> = S::Slice<'a> where 's: 'a; + type Slice<'a> + = S::Slice<'a> + where + 's: 'a; fn len(&self) -> usize { self.0.len()