From ce4de544ad5de9ee1342b7c3ab174f79170d6404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Medina?= Date: Sun, 1 Dec 2024 23:58:47 -0800 Subject: [PATCH] bump MSRV to 1.63 --- .github/workflows/test.yml | 8 ++++---- CHANGELOG.md | 5 +++++ Cargo.toml | 2 +- README.md | 6 +++--- faux_macros/Cargo.toml | 6 +++--- faux_macros/src/self_type.rs | 9 ++------- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4477431..3c5cdf0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,10 +16,10 @@ jobs: - name: test stable --release run: cargo +stable test --release --verbose # MSRV - - uses: dtolnay/rust-toolchain@1.58.1 + - uses: dtolnay/rust-toolchain@1.63.0 - name: build MSRV - run: cargo +1.58.1 build --verbose + run: cargo +1.63.0 build --verbose - name: test MSRV - run: cargo +1.58.1 test --verbose + run: cargo +1.63.0 test --verbose - name: test MSRV --release - run: cargo +1.58.1 test --release --verbose + run: cargo +1.63.0 test --release --verbose diff --git a/CHANGELOG.md b/CHANGELOG.md index 8219c23..1013654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGELOG +## NEXT +* Add support for mocking methods with generic parameters + * [test](/tests/generic_method_return.rs) +* Bump MSRV as v1.63 + ## v0.1.10 * Fix issue where methods that returned a type with a name that contains the name of the mocked struct would fail to compile. diff --git a/Cargo.toml b/Cargo.toml index 0bb6fcd..44a414d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/nrxus/faux" edition = "2021" keywords = ["mock", "mocking", "test", "testing", "faux"] readme = "README.md" -rust-version = "1.58" +rust-version = "1.63" [dependencies] faux_macros = { path = "faux_macros", version = "0.1.10" } diff --git a/README.md b/README.md index 3156a94..a4e6282 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# faux   [![Latest Version]][crates.io] [![rustc 1.58+]][Rust 1.58] [![docs]][api docs] ![][build] +# faux   [![Latest Version]][crates.io] [![rustc 1.63+]][Rust 1.63] [![docs]][api docs] ![][build] A library to create [mocks] out of structs. @@ -227,8 +227,8 @@ methods in structs. [Latest Version]: https://img.shields.io/crates/v/faux.svg [crates.io]: https://crates.io/crates/faux -[rustc 1.58+]: https://img.shields.io/badge/rustc-1.58+-blue.svg -[Rust 1.58]: https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html +[rustc 1.63+]: https://img.shields.io/badge/rustc-1.63+-blue.svg +[Rust 1.63]: https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html [Latest Version]: https://img.shields.io/crates/v/faux.svg [docs]: https://img.shields.io/badge/api-docs-blue.svg [api docs]: https://docs.rs/faux/ diff --git a/faux_macros/Cargo.toml b/faux_macros/Cargo.toml index 9085063..0f6c163 100644 --- a/faux_macros/Cargo.toml +++ b/faux_macros/Cargo.toml @@ -8,12 +8,12 @@ description = "Implementations for #[create], #[methods], when!" homepage = "https://github.com/nrxus/faux" repository = "https://github.com/nrxus/faux" keywords = ["mock", "mocking", "test", "testing", "faux"] -rust-version = "1.58" +rust-version = "1.63" [dependencies] syn = { version = "2", features = ["full", "extra-traits"] } -quote = "1.0.8" -proc-macro2 = "1.0.24" +quote = "1" +proc-macro2 = "1" darling = "0.20" uuid = { version = "1", features = ["v4"] } diff --git a/faux_macros/src/self_type.rs b/faux_macros/src/self_type.rs index f0b7bd9..8615512 100644 --- a/faux_macros/src/self_type.rs +++ b/faux_macros/src/self_type.rs @@ -3,11 +3,12 @@ use proc_macro2::TokenStream; use quote::quote; use std::fmt::{self, Formatter}; -#[derive(FromMeta, PartialEq, Eq, Copy, Clone)] +#[derive(FromMeta, PartialEq, Eq, Copy, Clone, Default)] #[darling(rename_all = "PascalCase")] pub enum SelfType { Rc, #[darling(rename = "owned")] + #[default] Owned, Arc, Box, @@ -30,12 +31,6 @@ impl SelfType { } } -impl Default for SelfType { - fn default() -> Self { - SelfType::Owned - } -} - impl fmt::Display for SelfType { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { (match self {