From 14d7e281329e034f1a93453790c1730d43ed9a98 Mon Sep 17 00:00:00 2001 From: Renaud Denis Date: Wed, 4 Mar 2026 17:06:01 +0100 Subject: [PATCH 1/5] Add agents instructions --- .cursorrules | 1 + .junie/guidelines.md | 1 + AGENTS.md | 51 ++++++++++++++++++++++++++++++++++++++++++++ CLAUDE.md | 1 + GEMINI.md | 1 + agents/.gitkeep | 0 6 files changed, 55 insertions(+) create mode 120000 .cursorrules create mode 120000 .junie/guidelines.md create mode 100644 AGENTS.md create mode 120000 CLAUDE.md create mode 120000 GEMINI.md create mode 100644 agents/.gitkeep diff --git a/.cursorrules b/.cursorrules new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/.cursorrules @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/.junie/guidelines.md b/.junie/guidelines.md new file mode 120000 index 0000000..be77ac8 --- /dev/null +++ b/.junie/guidelines.md @@ -0,0 +1 @@ +../AGENTS.md \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..2f73c87 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,51 @@ +# Agent Instructions + +## Project Overview + +This repository contains the `unit-enum` Rust crate, a procedural macro (`#[derive(UnitEnum)]`) for enums that are primarily composed of unit variants. It generates utility methods such as `name`, `ordinal`, `from_ordinal`, `discriminant`, `from_discriminant`, `len`, and `values`, while respecting the enum's `#[repr]` and optionally supporting a single `"other"` catch‑all variant. + +## File Structure and Organization + +- **AGENTS.md**: Root instruction file for AI agents (this file). Also used via symlinks by other tools. +- **README.md**: Human-facing crate documentation and quick-start examples. +- **Cargo.toml**: Crate metadata, dependencies, and configuration (`proc-macro = true`). +- **src/lib.rs**: Implementation of the `UnitEnum` derive macro and its validation / codegen logic. +- **src/lib.md**: Crate-level Rustdoc included into the library docs; keep examples and text in sync with `README.md`. +- **examples/**: Small runnable binaries (`example.rs`, `example_other.rs`) that demonstrate typical usage, including the optional `"other"` variant. +- **.github/workflows/rust.yml**: GitHub Actions workflow for CI (build/tests). +- **CHANGELOG.md**: Human-maintained change log; follow existing style when documenting externally visible changes. +- **LICENSE-MIT**, **LICENSE-APACHE**: Dual licensing information. +- **agents/**: Reserved for generic, reusable, and versioned instruction documents. Do not modify from within this project; treat contents (if any) as read-only. + +## Symbolic Links + +This AGENTS.md file is symlinked for compatibility with different AI agents: + +- `CLAUDE.md` → `AGENTS.md` +- `.junie/guidelines.md` → `AGENTS.md` +- `GEMINI.md` → `AGENTS.md` +- `.cursorrules` → `AGENTS.md` + +Any changes you make here automatically apply to those entrypoints; keep instructions tool-agnostic. + +## Development Guidelines + +### Code Organization + +- Maintain a clear separation between agent instructions (`AGENTS.md`) and human documentation (`README.md`, `CHANGELOG.md`, crate docs in `src/lib.md`). +- Keep instructions dense, unambiguous, and optimized for AI processing (short sections, explicit bullets, minimal prose). +- When modifying macro behavior in `src/lib.rs`, also: + - Update or add examples in `src/lib.md`, `README.md`, and `examples/` as appropriate. + - Preserve the documented semantics of generated methods (`name`, `ordinal`, `discriminant`, etc.) unless the change is intentionally breaking and coordinated with versioning. +- Do not modify files under `agents/` from this repository; treat them as shared, versioned guidance. + +### Rust & Testing + +- Use `cargo test` (and, if relevant, `cargo test --examples`) to validate changes; this runs doctests in `src/lib.md` and `README.md` as well as any unit tests. +- Prefer adding or updating doctests and examples when fixing bugs or changing behavior in the derive macro. +- Avoid introducing public API changes without updating documentation and, when applicable, bumping versions and changelog entries in coordination with maintainers. + +### File Management + +- Only modify `AGENTS.md` directly; its symbolic links (`CLAUDE.md`, `.junie/guidelines.md`, `GEMINI.md`, `.cursorrules`) should not be edited independently. +- After making non-trivial changes to the crate or its structure, update this `AGENTS.md` to reflect the current project state so future agents have accurate context. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/GEMINI.md b/GEMINI.md new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/GEMINI.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/agents/.gitkeep b/agents/.gitkeep new file mode 100644 index 0000000..e69de29 From 45c46878b15412fa6773f121f7ebd5c8d7b5d89a Mon Sep 17 00:00:00 2001 From: Renaud Denis Date: Wed, 4 Mar 2026 17:38:56 +0100 Subject: [PATCH 2/5] Make generated methods const-friendly; Document the minimum supported Rust version (MSRV) --- .github/workflows/rust.yml | 8 ++++++++ CHANGELOG.md | 7 +++++++ Cargo.toml | 1 + README.md | 35 +++++++++++++++++++++++++++++++++++ src/lib.md | 33 +++++++++++++++++++++++++++++++++ src/lib.rs | 14 +++++++------- 6 files changed, 91 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3bfe670..2eafde5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,10 +11,18 @@ env: jobs: build: + strategy: + matrix: + rust: ["1.71.0", "stable"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true - name: Build run: cargo build --verbose - name: Run tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 641012e..408ab72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Next + +### Added + +- Make `name`, `ordinal`, `from_ordinal`, `discriminant`, `from_discriminant`, and `len` const-friendly by generating them as `const fn` +- Document the minimum supported Rust version (MSRV) as Rust 1.71 and add a section describing const usage in the documentation + ## Version 1.4.3 (2025-05-20) ### Fixed diff --git a/Cargo.toml b/Cargo.toml index 8572190..fcdbdcf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ repository = "https://github.com/tylium/unit-enum" keywords = ["enum", "derive", "proc_macro", "procmacro"] edition = "2021" readme = "README.md" +rust-version = "1.71" [lib] proc-macro = true diff --git a/README.md b/README.md index 28e5cd9..f1c73a8 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ consisting of unit variants. This macro simplifies working with such enums by pr ## Supported Enum Types The macro supports two types of enums: + 1. Enums with only unit variants 2. Enums with unit variants plus one "other" variant for handling undefined discriminant values @@ -32,6 +33,10 @@ Add the following to your `Cargo.toml`: unit-enum = "1.4.1" ``` +## Minimum Supported Rust Version (MSRV) + +This crate supports **Rust 1.71+**. + ## Quick Start ### Basic Usage (Unit Variants Only) @@ -77,6 +82,34 @@ fn main() { } ``` +### Const-friendly methods + +Because all enum information is known at compile time, most of the generated +methods are available as `const fn` and can be used in constant contexts. + +```rust +use unit_enum::UnitEnum; + +#[derive(Debug, Clone, Copy, PartialEq, UnitEnum)] +enum Status { + Active = 1, + Pending, // 2 + Inactive = 5, +} + +const STATUS_COUNT: usize = Status::len(); +const FIRST_NAME: &str = Status::Active.name(); +const FROM_ORDINAL: Option = Status::from_ordinal(1); +const FROM_DISCRIMINANT: Option = Status::from_discriminant(1); + +fn main() { + assert_eq!(STATUS_COUNT, 3); + assert_eq!(FIRST_NAME, "Active"); + assert_eq!(FROM_ORDINAL, Some(Status::Pending)); + assert_eq!(FROM_DISCRIMINANT, Some(Status::Active)); +} +``` + ### Usage with "Other" Variant ```rust @@ -114,6 +147,7 @@ fn main() { ## Discriminant Types The crate respects the enum's `#[repr]` attribute to determine the type of discriminant values. Supported types include: + - `#[repr(i8)]`, `#[repr(i16)]`, `#[repr(i32)]`, `#[repr(i64)]`, `#[repr(i128)]` - `#[repr(u8)]`, `#[repr(u16)]`, `#[repr(u32)]`, `#[repr(u64)]`, `#[repr(u128)]` @@ -141,6 +175,7 @@ enum LargeEnum { ## Requirements for "Other" Variant When using an "other" variant, the following requirements must be met: + - The enum must have a `#[repr(type)]` attribute - Only one variant can be marked with `#[unit_enum(other)]` - The "other" variant must have exactly one unnamed field matching the repr type diff --git a/src/lib.md b/src/lib.md index 9dcde0b..cbfa363 100644 --- a/src/lib.md +++ b/src/lib.md @@ -44,6 +44,34 @@ assert_eq!( ); ``` +## Const-friendly methods + +Because all enum information is known at compile time, most of the generated +methods are available as `const fn` and can be used in constant contexts. + +```rust +use unit_enum::UnitEnum; + +#[derive(Debug, Clone, Copy, PartialEq, UnitEnum)] +enum Status { + Active = 1, + Pending, // 2 + Inactive = 5, +} + +const STATUS_COUNT: usize = Status::len(); +const FIRST_NAME: &str = Status::Active.name(); +const FROM_ORDINAL: Option = Status::from_ordinal(1); +const FROM_DISCRIMINANT: Option = Status::from_discriminant(1); + +fn main() { + assert_eq!(STATUS_COUNT, 3); + assert_eq!(FIRST_NAME, "Active"); + assert_eq!(FROM_ORDINAL, Some(Status::Pending)); + assert_eq!(FROM_DISCRIMINANT, Some(Status::Active)); +} +``` + ## Usage with "Other" Variant The macro also supports enums with an additional "other" variant for handling undefined discriminant values: @@ -113,6 +141,11 @@ Supported types include: If no `#[repr]` is specified, `i32` is used by default. Note that when using an "other" variant, the `#[repr]` attribute is required and must match the type of the "other" variant's field. +## Minimum Supported Rust Version (MSRV) + +This crate supports **Rust 1.71+**. +All const-friendly methods described above are available on this MSRV. + ## Requirements For basic unit-only enums: diff --git a/src/lib.rs b/src/lib.rs index d510b9b..68aa48d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -210,7 +210,7 @@ fn impl_unit_enum( /// /// assert_eq!(Example::len(), 2); /// ``` - pub fn len() -> usize { + pub const fn len() -> usize { #num_variants } @@ -252,7 +252,7 @@ fn generate_name_impl( /// assert_eq!(Example::B.name(), "B"); /// assert_eq!(Example::C.name(), "C"); /// ``` - pub fn name(&self) -> &str { + pub const fn name(&self) -> &str { match self { #(#unit_match_arms,)* #other_arm @@ -297,7 +297,7 @@ fn generate_ordinal_impl( /// assert_eq!(Example::B.ordinal(), 1); /// assert_eq!(Example::C.ordinal(), 2); /// ``` - pub fn ordinal(&self) -> usize { + pub const fn ordinal(&self) -> usize { match self { #(#unit_match_arms,)* #other_arm @@ -337,7 +337,7 @@ fn generate_from_ordinal_impl( /// assert_eq!(Example::from_ordinal(2), None); // Other variant /// assert_eq!(Example::from_ordinal(99), None); // Out of range /// ``` - pub fn from_ordinal(ord: usize) -> Option { + pub const fn from_ordinal(ord: usize) -> Option { match ord { #(#match_arms,)* _ => None @@ -383,7 +383,7 @@ fn generate_discriminant_impl( /// assert_eq!(Example::B.discriminant(), 10); /// assert_eq!(Example::C.discriminant(), 11); /// ``` - pub fn discriminant(&self) -> #discriminant_type { + pub const fn discriminant(&self) -> #discriminant_type { match self { #(#unit_match_arms,)* #other_arm @@ -429,7 +429,7 @@ fn generate_from_discriminant_impl( /// assert_eq!(Example::from_discriminant(10), Example::B); /// assert_eq!(Example::from_discriminant(42), Example::Other(42)); /// ``` - pub fn from_discriminant(discr: #discriminant_type) -> Self { + pub const fn from_discriminant(discr: #discriminant_type) -> Self { match discr { #(#match_arms,)* other => #name::#other_name(other) @@ -464,7 +464,7 @@ fn generate_from_discriminant_impl( /// assert_eq!(Example::from_discriminant(10), Some(Example::B)); /// assert_eq!(Example::from_discriminant(42), None); /// ``` - pub fn from_discriminant(discr: #discriminant_type) -> Option { + pub const fn from_discriminant(discr: #discriminant_type) -> Option { match discr { #(#match_arms,)* _ => None From 68bba8f08d900e32f31bdd1a0d6f0053fc1a5683 Mon Sep 17 00:00:00 2001 From: Renaud Denis Date: Wed, 4 Mar 2026 17:48:53 +0100 Subject: [PATCH 3/5] Stop tracking Cargo.lock for library crate --- Cargo.lock | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 23a3818..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,47 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "syn" -version = "2.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unit-enum" -version = "1.4.3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] From c65ffcc8d742865480ad40515fe1c9d5b9ebc076 Mon Sep 17 00:00:00 2001 From: Renaud Denis Date: Wed, 4 Mar 2026 17:27:13 +0100 Subject: [PATCH 4/5] Add rustfmt rules and reformat codebase --- .rustfmt.toml | 19 ++++++++++ examples/example.rs | 2 +- examples/example_other.rs | 2 +- src/lib.rs | 76 ++++++++++++++++----------------------- 4 files changed, 52 insertions(+), 47 deletions(-) create mode 100644 .rustfmt.toml diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000..25ef317 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,19 @@ +style_edition = "2021" +max_width = 120 + +group_imports = "StdExternalCrate" + +normalize_doc_attributes = true +normalize_comments = true +wrap_comments = true + +reorder_modules = false + +reorder_impl_items = true + +where_single_line = true +fn_params_layout = "Compressed" +fn_single_line = true + +use_field_init_shorthand = true +use_try_shorthand = true diff --git a/examples/example.rs b/examples/example.rs index 7a61660..3a266db 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -34,4 +34,4 @@ fn main() { Color::values().collect::>(), vec![Color::Red, Color::Green, Color::Blue] ); -} \ No newline at end of file +} diff --git a/examples/example_other.rs b/examples/example_other.rs index c29db43..c17d7b6 100644 --- a/examples/example_other.rs +++ b/examples/example_other.rs @@ -38,4 +38,4 @@ fn main() { Color::values().collect::>(), vec![Color::Red, Color::Green, Color::Blue] ); -} \ No newline at end of file +} diff --git a/src/lib.rs b/src/lib.rs index 68aa48d..af9f48b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,8 +2,7 @@ use proc_macro::TokenStream; use quote::quote; -use syn::{parse_macro_input, Data, DeriveInput, Error, Expr, Fields - , Type, Variant}; +use syn::{parse_macro_input, Data, DeriveInput, Error, Expr, Fields, Type, Variant}; /// Derives the `UnitEnum` trait for an enum. /// @@ -122,7 +121,8 @@ fn validate_and_process(ast: &DeriveInput) -> Result<(Type, Vec<&Variant>, Optio } fn get_discriminant_type(ast: &DeriveInput) -> Result { - ast.attrs.iter() + ast.attrs + .iter() .find(|attr| attr.path().is_ident("repr")) .map_or(Ok(syn::parse_quote!(i32)), |attr| { attr.parse_args::() @@ -136,14 +136,16 @@ fn has_unit_enum_attr(variant: &Variant) -> bool { fn has_unit_enum_other_attr(variant: &Variant) -> bool { variant.attrs.iter().any(|attr| { - attr.path().is_ident("unit_enum") && - attr.parse_nested_meta(|meta| { - if meta.path.is_ident("other") { - Ok(()) - } else { - Err(meta.error("Invalid unit_enum attribute")) - } - }).is_ok() + attr.path().is_ident("unit_enum") + && attr + .parse_nested_meta(|meta| { + if meta.path.is_ident("other") { + Ok(()) + } else { + Err(meta.error("Invalid unit_enum attribute")) + } + }) + .is_ok() }) } @@ -152,10 +154,11 @@ fn compute_discriminants(variants: &[&Variant]) -> Vec { let mut last_discriminant: Option = None; for variant in variants { - let discriminant = variant.discriminant.as_ref().map(|(_, expr)| expr.clone()) - .or_else(|| { - last_discriminant.clone().map(|expr| syn::parse_quote! { #expr + 1 }) - }) + let discriminant = variant + .discriminant + .as_ref() + .map(|(_, expr)| expr.clone()) + .or_else(|| last_discriminant.clone().map(|expr| syn::parse_quote! { #expr + 1 })) .unwrap_or_else(|| syn::parse_quote! { 0 }); discriminants.push(discriminant.clone()); @@ -166,10 +169,7 @@ fn compute_discriminants(variants: &[&Variant]) -> Vec { } fn impl_unit_enum( - ast: &DeriveInput, - discriminant_type: &Type, - unit_variants: &[&Variant], - other_variant: Option<(&Variant, Type)>, + ast: &DeriveInput, discriminant_type: &Type, unit_variants: &[&Variant], other_variant: Option<(&Variant, Type)>, ) -> TokenStream { let name = &ast.ident; let num_variants = unit_variants.len(); @@ -178,8 +178,10 @@ fn impl_unit_enum( let name_impl = generate_name_impl(name, unit_variants, &other_variant); let ordinal_impl = generate_ordinal_impl(name, unit_variants, &other_variant, num_variants); let from_ordinal_impl = generate_from_ordinal_impl(name, unit_variants); - let discriminant_impl = generate_discriminant_impl(name, unit_variants, &other_variant, discriminant_type, &discriminants); - let from_discriminant_impl = generate_from_discriminant_impl(name, unit_variants, &other_variant, discriminant_type, &discriminants); + let discriminant_impl = + generate_discriminant_impl(name, unit_variants, &other_variant, discriminant_type, &discriminants); + let from_discriminant_impl = + generate_from_discriminant_impl(name, unit_variants, &other_variant, discriminant_type, &discriminants); let values_impl = generate_values_impl(name, unit_variants, &discriminants, &other_variant); quote! { @@ -216,13 +218,12 @@ fn impl_unit_enum( #values_impl } - }.into() + } + .into() } fn generate_name_impl( - name: &syn::Ident, - unit_variants: &[&Variant], - other_variant: &Option<(&Variant, Type)>, + name: &syn::Ident, unit_variants: &[&Variant], other_variant: &Option<(&Variant, Type)>, ) -> proc_macro2::TokenStream { let unit_match_arms = unit_variants.iter().map(|variant| { let variant_name = &variant.ident; @@ -262,10 +263,7 @@ fn generate_name_impl( } fn generate_ordinal_impl( - name: &syn::Ident, - unit_variants: &[&Variant], - other_variant: &Option<(&Variant, Type)>, - num_variants: usize, + name: &syn::Ident, unit_variants: &[&Variant], other_variant: &Option<(&Variant, Type)>, num_variants: usize, ) -> proc_macro2::TokenStream { let unit_match_arms = unit_variants.iter().enumerate().map(|(index, variant)| { let variant_name = &variant.ident; @@ -305,10 +303,7 @@ fn generate_ordinal_impl( } } } -fn generate_from_ordinal_impl( - name: &syn::Ident, - unit_variants: &[&Variant], -) -> proc_macro2::TokenStream { +fn generate_from_ordinal_impl(name: &syn::Ident, unit_variants: &[&Variant]) -> proc_macro2::TokenStream { let match_arms = unit_variants.iter().enumerate().map(|(index, variant)| { let variant_name = &variant.ident; quote! { #index => Some(#name::#variant_name) } @@ -347,10 +342,7 @@ fn generate_from_ordinal_impl( } fn generate_discriminant_impl( - name: &syn::Ident, - unit_variants: &[&Variant], - other_variant: &Option<(&Variant, Type)>, - discriminant_type: &Type, + name: &syn::Ident, unit_variants: &[&Variant], other_variant: &Option<(&Variant, Type)>, discriminant_type: &Type, discriminants: &[Expr], ) -> proc_macro2::TokenStream { let unit_match_arms = unit_variants.iter().zip(discriminants).map(|(variant, discriminant)| { @@ -393,10 +385,7 @@ fn generate_discriminant_impl( } fn generate_from_discriminant_impl( - name: &syn::Ident, - unit_variants: &[&Variant], - other_variant: &Option<(&Variant, Type)>, - discriminant_type: &Type, + name: &syn::Ident, unit_variants: &[&Variant], other_variant: &Option<(&Variant, Type)>, discriminant_type: &Type, discriminants: &[Expr], ) -> proc_macro2::TokenStream { if let Some((other_variant, _)) = other_variant { @@ -475,10 +464,7 @@ fn generate_from_discriminant_impl( } fn generate_values_impl( - name: &syn::Ident, - unit_variants: &[&Variant], - discriminants: &[Expr], - _other_variant: &Option<(&Variant, Type)>, + name: &syn::Ident, unit_variants: &[&Variant], discriminants: &[Expr], _other_variant: &Option<(&Variant, Type)>, ) -> proc_macro2::TokenStream { // Create a vector of variant expressions paired with their discriminants let variant_exprs = unit_variants.iter().zip(discriminants).map(|(variant, _discriminant)| { From bfb5b4b4ae262e8dd1782668f49977066c1f1b4e Mon Sep 17 00:00:00 2001 From: Renaud Denis Date: Wed, 4 Mar 2026 18:04:21 +0100 Subject: [PATCH 5/5] Release 1.5.0 --- CHANGELOG.md | 2 +- Cargo.toml | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 408ab72..86fbed7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Next +## Version 1.5.0 (2026-03-04) ### Added diff --git a/Cargo.toml b/Cargo.toml index fcdbdcf..e15226c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unit-enum" -version = "1.4.3" +version = "1.5.0" authors = ["Renaud Denis "] description = "A procedural macro for deriving ordinal methods in unit-like enums for Rust." license = "MIT OR Apache-2.0" diff --git a/README.md b/README.md index f1c73a8..f24157e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Add the following to your `Cargo.toml`: ```toml [dependencies] -unit-enum = "1.4.1" +unit-enum = "1" ``` ## Minimum Supported Rust Version (MSRV)