Flexible deriving macro.

Overview


Matrix Test crate-name at crates.io crate-name at docs.rs

This library is a slightly more convenient version of derive for newtype pattern.

=> See also Deriving via

Basic Usage

#[derive(DerivingVia)] and then write the #[deriving] attribute on struct and list the trait you want to derive in it.

simple

Derives From<i32> for D and Display for D.

#[derive(DerivingVia)]
#[deriving(From, Display)]
pub struct D(i32);

with generics

#[derive(DerivingVia)]
#[deriving(From, Display)]
pub struct D<T: Display>(T);

with newtype pattern

If you have more than one field, specify #[underlying] for one. Note that the other fields require default initialisation by the Default trait.

#[derive(DerivingVia)]
#[deriving(From, Display)]
pub struct Test<T>(#[underlying] i32, std::marker::PhantomData<T>);

Syntax

Derive DerivingVia and list the traits you want to derive in the #[deriving] attribute.

#[derive(DerivingVia)]
#[deriving(<Derive>...)]
struct Target(Base);

The syntax of <Derive> is defined as follows.

Derive := <Trait> | <Trait>(via: <Type>)

Deriving Via

Using the deriving via feature, it is possible to generate derives from the impl of a base of a multi-layered wrapped type.

DerivingVia uses transitive type coercion for type conversion. All newtypes must be dereferenceable to the underlying type. Therefore, DerivingVia automatically generates a Deref trait.

Example

use deriving_via::DerivingVia;

#[derive(DerivingVia)]
pub struct A(i32);

#[derive(DerivingVia)]
pub struct B(A);

#[derive(DerivingVia)]
#[deriving(Display(via: i32))]
pub struct C(B);

fn main() {
  let c = C(B(A(42)));
  println!("{c}"); // 42
}

Deref trait works transitive, but how we re-constructs a Self type? Unfortunately, no convenience mechanism exists in the language, so it is necessary to teach how to revert using the #[transitive] attribute. Some trait require #[transitive] attribute (see Available Derives section).

Example

use std::fmt::Display;

use deriving_via::DerivingVia;

#[derive(DerivingVia)]
#[deriving(From)]
pub struct A(i32);

#[derive(DerivingVia)]
#[deriving(From)]
pub struct B(A);

#[derive(DerivingVia)]
#[deriving(From, Add(via: i32), Display(via: i32))]
#[transitive(i32 -> A -> B -> C)]
pub struct C(B);

fn main() {
  let c = C(B(A(42))) + C(B(A(42)));
  println!("{c}");
}

Available Derives

struct Base(Underlying);

#[derive(DerivingVia)]
#[deriving(<Derive>)]
struct Target(Base);
  • fmt
    • Display
      • requires: Base: Display or (via = <Type>) and Type: Display
  • ops
    • Eq
      • requires: Base: Eq or (via = <Type>) and Type: Eq
    • Ord
      • requires: Base: Ord or (via = <Type>) and Type: Ord
    • Add-lile (Add, Sub)
      • requires: Base: From<Underlying>
      • limitations: one hop or #[transitive]
    • Mul-like (Mul, Div)
      • requires: Base: From<Underlying>
      • limitations: one hop or #[transitive]
    • Arithmetic (Add, Sub, Mul, Div)
      • requires: Base: From<Underlying>
      • limitations: one hop or #[transitive]
    • Index
      • requires: Base: Index or (via = <Type>) and Type: Index
    • IndexMut
      • requires: Base: IndexMut or (via = <Type>) and Type: IndexMut
    • DerefMut
      • requires: Base: DerefMut or (via = <Type>) and Type: DerefMut
  • hash
    • Hash
      • requires: Base: Hash or (via = <Type>) and Type: Hash
  • serde
    • Serialize
      • requires: Base: Serialize or (via = <Type>) and Type: Serialize
    • Deserialize
      • requires: Base: Deserialize or (via = <Type>) and Type: Deserialize
  • convert
    • AsRef
    • AsMut
    • FromIterator
      • requires: (via: <ItemType>)
    • IntoIterator
      • requires: Base: IntoIterator or (via: <Type>), Type: IntoIterator
    • Into
      • requires: Base: Into<Underlying>
      • limitations: one hop or #[transitive]
    • From
      • limitations: one hop or #[transitive]
    • TryFrom
      • requires: Base: From<Underlying>
      • limitations: one hop or #[transitive]
    • FromStr
      • requires: Base: From<Underlying>
      • limitations: one hop or #[transitive]
  • impls
    • Iter
      • requires: Base: IntoIterator and Base dereferenceable to slice or (via: <Type>), Type: IntoIterator and Type dereferenceable to slice

Caveat

DerivingVia using transitive case of Type Coercion. According to rumours, transitive Type Coercion is not fully supported yet.

See: https://doc.rust-lang.org/reference/type-coercions.html#coercion-types

Comments
  • fix(deps): update rust crate syn to 2.0.11

    fix(deps): update rust crate syn to 2.0.11

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | syn | dependencies | patch | 2.0.10 -> 2.0.11 |


    Release Notes

    dtolnay/syn

    v2.0.11

    Compare Source

    • Improve error message on empty parens inside parse_nested_meta (#​1428)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • deriving_via/Cargo.toml (cargo)
    • example/Cargo.toml (cargo)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation.
    • If Renovate detects semantic commits, it will use semantic commit type fix for dependencies and chore for all others.
    • Ignore node_modules, bower_components, vendor and various test/tests directories.
    • Automatically detect the best rangeStrategy to use.
    • Rate limit PR creation to a maximum of two per hour.
    • Limit to maximum 10 open PRs at any time.
    • Group known monorepo packages together.
    • Use curated list of recommended non-monorepo package groupings.
    • A collection of workarounds for known problems with packages.

    πŸ”‘ Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • fix(deps): update rust crate proc-macro2 to 1.0.56

    fix(deps): update rust crate proc-macro2 to 1.0.56

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | proc-macro2 | dependencies | patch | 1.0.55 -> 1.0.56 |


    Release Notes

    dtolnay/proc-macro2

    v1.0.56

    Compare Source

    • Circumvent clippy::octal_escapes lint inside generated string and byte-string literals (#​363, #​380)
    • Provide RefUnwindSafe impls for compilers older than 1.58 (#​382)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate syn to 2.0.13

    fix(deps): update rust crate syn to 2.0.13

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | syn | dependencies | patch | 2.0.12 -> 2.0.13 |


    Release Notes

    dtolnay/syn

    v2.0.13

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate proc-macro2 to 1.0.55

    fix(deps): update rust crate proc-macro2 to 1.0.55

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | proc-macro2 | dependencies | patch | 1.0.54 -> 1.0.55 |


    Release Notes

    dtolnay/proc-macro2

    v1.0.55

    Compare Source

    • Set a meaningful Span for literals produced via the FromStr impl of Literal (#​378)
    • Implement Literal::subspan in non-macro contexts when "span-locations" feature is enabled (#​379)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate syn to 2.0.12

    fix(deps): update rust crate syn to 2.0.12

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | syn | dependencies | patch | 2.0.11 -> 2.0.12 |


    Release Notes

    dtolnay/syn

    v2.0.12

    Compare Source

    • Refer to compile_error! by absolute path in token stream produced by syn::Error::to_compile_error (#​1431, thanks @​smoelius)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate serde to 1.0.159

    fix(deps): update rust crate serde to 1.0.159

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | serde (source) | dependencies | patch | 1.0.158 -> 1.0.159 |


    Release Notes

    serde-rs/serde

    v1.0.159

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate serde_json to 1.0.95

    fix(deps): update rust crate serde_json to 1.0.95

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | serde_json | dependencies | patch | 1.0.94 -> 1.0.95 |


    Release Notes

    serde-rs/json

    v1.0.95

    Compare Source

    • Preserve f32 precision when serializing f32 -> serde_json::Value -> JSON string in "arbitrary_precision" mode (#​1004, #​1005)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate proc-macro2 to 1.0.54

    fix(deps): update rust crate proc-macro2 to 1.0.54

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | proc-macro2 | dependencies | patch | 1.0.53 -> 1.0.54 |


    Release Notes

    dtolnay/proc-macro2

    v1.0.54

    Compare Source

    • Performance improvement to "span-locations" feature (#​373)
    • Fix unbounded memory usage when calling proc-macro2's parser from a fuzzer (#​374)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate syn to 2.0.10

    fix(deps): update rust crate syn to 2.0.10

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | syn | dependencies | patch | 2.0.8 -> 2.0.10 |


    Release Notes

    dtolnay/syn

    v2.0.10

    Compare Source

    • Fix visibility being parsed incorrectly on macro invocations inside of a trait

    v2.0.9

    Compare Source

    • Disallow type items in an extern block, trait, or module from being marked default

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate syn to 2.0.8

    fix(deps): update rust crate syn to 2.0.8

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | syn | dependencies | patch | 2.0.7 -> 2.0.8 |


    Release Notes

    dtolnay/syn

    v2.0.8

    Compare Source

    • Treat try keyword as 2015-edition identifier in definition of try macro (#​1422)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    This repository currently has no open or pending branches.

    Detected dependencies

    cargo
    deriving_via/Cargo.toml
    • proc-macro-error 1.0.4
    • proc-macro2 1.0.56
    • quote 1.0.26
    • syn 2.0.13
    • typed-builder 0.14.0
    • strum 0.24.1
    • strum_macros 0.24.3
    • itertools 0.10.5
    • deriving-via-impl 0.1.0
    • cargo-husky 1
    deriving_via_impl/Cargo.toml
    • proc-macro2 1.0.56
    • quote 1.0.26
    • syn 2.0.13
    • convert_case 0.6.0
    example/basics/Cargo.toml
    • serde 1.0.159
    • serde_json 1.0.95
    • cargo-husky 1
    example/id/Cargo.toml
    • anyhow 1.0.70
    • cargo-husky 1
    example/serialize/Cargo.toml
    • serde 1.0.159
    • serde_json 1.0.95
    • cargo-husky 1
    github-actions
    .github/workflows/audit.yml
    • actions/checkout v3
    • actions-rs/audit-check v1
    .github/workflows/ci.yml
    • actions/checkout v3
    • actions-rs/toolchain v1
    • actions/checkout v3
    • actions-rs/toolchain v1
    • actions/checkout v3
    • actions-rs/toolchain v1
    • actions/cache v3
    • actions/cache v3
    • actions-rs/cargo v1
    • actions-rs/cargo v1

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Releases(v1.2.0)
  • v1.2.0(Apr 6, 2023)

    What's Changed

    • fix(deps): update rust crate serde_json to 1.0.95 by @renovate in https://github.com/LoliGothick/deriving_via/pull/21
    • fix(deps): update rust crate serde to 1.0.159 by @renovate in https://github.com/LoliGothick/deriving_via/pull/22
    • fix(deps): update rust crate syn to 2.0.11 by @renovate in https://github.com/LoliGothick/deriving_via/pull/23
    • fix(deps): update rust crate syn to 2.0.12 by @renovate in https://github.com/LoliGothick/deriving_via/pull/24
    • fix(deps): update rust crate syn to 2.0.13 by @renovate in https://github.com/LoliGothick/deriving_via/pull/26
    • fix(deps): update rust crate proc-macro2 to 1.0.55 by @renovate in https://github.com/LoliGothick/deriving_via/pull/25
    • fix(deps): update rust crate proc-macro2 to 1.0.56 by @renovate in https://github.com/LoliGothick/deriving_via/pull/27
    • feat(deriving_via): const generics by @LoliGothick in https://github.com/LoliGothick/deriving_via/pull/28

    New Contributors

    • @LoliGothick made their first contribution in https://github.com/LoliGothick/deriving_via/pull/28

    Full Changelog: https://github.com/LoliGothick/deriving_via/compare/v1.1.4...v1.2.0

    Source code(tar.gz)
    Source code(zip)
  • v1.1.4(Mar 26, 2023)

    What's Changed

    • DerefMut is generated default by DerivingVia
    • add AddAssign and MulAssign

    Full Changelog: https://github.com/LoliGothick/deriving_via/compare/v1.1.3...v1.1.4

    Source code(tar.gz)
    Source code(zip)
  • v1.1.3(Mar 26, 2023)

    What's Changed

    • fix(deps): update rust crate syn to 2.0.2 by @renovate in https://github.com/LoliGothick/deriving_via/pull/11
    • fix(deps): update rust crate syn to 2.0.3 by @renovate in https://github.com/LoliGothick/deriving_via/pull/12
    • fix(deps): update rust crate serde to 1.0.158 by @renovate in https://github.com/LoliGothick/deriving_via/pull/13

    Full Changelog: https://github.com/LoliGothick/deriving_via/compare/v1.1.2...v1.1.3

    Source code(tar.gz)
    Source code(zip)
  • v1.1.2(Mar 18, 2023)

  • v1.1.1(Mar 14, 2023)

    What's Changed

    Full Changelog: https://github.com/LoliGothick/deriving_via/compare/v1.0.1...v1.1.1

    New Derives

    • AsMut
    • DerefMut
    • Index
    • IndexMut
    • FromIterator
    • IntoIterator
    • Iter

    Bug fixes

    • disallow multiple #[underlying]
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Mar 12, 2023)

  • v1.0.0(Mar 11, 2023)

  • v0.3.2(Mar 11, 2023)

  • v0.3.1(Mar 9, 2023)

  • v0.3.0(Mar 9, 2023)

  • v0.2.0(Mar 8, 2023)

  • v0.1.0(Mar 6, 2023)

Owner
Mitama
I am a God.
Mitama
A flexible simple theme manager for *nix systems

tema A theme manager for *nix systems respecting the FHS spec configuration As of now all the configuration is done via $XDG_CONFIG_HOME/tema/config.y

lb06 2 Sep 23, 2022
High-performance, low-level framework for composing flexible web integrations

High-performance, low-level framework for composing flexible web integrations. Used mainly as a dependency of `barter-rs` project

Barter 8 Dec 28, 2022
RedMaple offers an oppinionated yet extremely flexible data modeling system based on events for back-end applications.

RedMaple offers an oppinionated yet extremely flexible data modeling system based on events for back-end applications.

Amir Alesheikh 4 Mar 5, 2023
AI-TOML Workflow Specification (aiTWS), a comprehensive and flexible specification for defining arbitrary Ai centric workflows.

AI-TOML Workflow Specification (aiTWS) The AI-TOML Workflow Specification (aiTWS) is a flexible and extensible specification for defining arbitrary wo

ruv 20 Apr 8, 2023
Quick'n dirty macro set for advent of code 2021

AOC quick'n dirty macro set Those are implemented using quick'n dirty procedural macros and libraries. Running the program Use cargo run --release --

Samuel Tardieu 3 Dec 25, 2021
Semantic find-and-replace using tree-sitter-based macro expansion

Semantic find-and-replace using tree-sitter-based macro expansion

Isaac Clayton 15 Nov 10, 2022
An html macro for dioxus applications.

dioxus html macro This crate offers an html! like macro for dioxus applications. It expands to the equivalent rsx! macro call you would have made othe

Dioxus Labs 8 Dec 22, 2022
An attribute macro to simplify writing simple command line applications.

fncli An attribute macro to simplify writing simple command line applications. Example #[fncli::cli] fn main(a: i32, b: i32) { println!("{}", a +

Vidhan Bhatt 29 Dec 15, 2022
Macro to customize the behavior of `?`

::custom-try Macro to customize the behavior of ? Examples use ::custom_try::custom_try; #[repr(transparent)] pub struct FfiResult { pub status_c

Daniel Henry-Mantilla 5 Dec 23, 2022
A micro crate that simplifies a bit the use of the std macro thread_local!.

with-thread-local A micro crate that simplifies a bit the use of the std macro thread_local!. extern crate regex; use with_thread_local::with_thread_

Cecile Tonglet 3 Jan 11, 2023
A convenient macro for building PathBufs in Rust.

pathbuf pathbuf is a simple crate which provides the pathbuf macro to conveniently construct the Rust PathBuf type. Example use pathbuf::pathbuf; use

Andrew Lilley Brinker 6 Jan 16, 2023
A formatter for the leptos view! macro

leptosfmt A formatter for the leptos view! macro All notable changes are documented in: CHANGELOG.md Install cargo install leptosfmt or for trying out

Bram 13 Apr 4, 2023
ChatGPT powered Rust proc macro that generates code at compile-time.

gpt-macro ChatGPT powered Rust proc macro that generates code at compile-time. Implemented Macros auto_impl!{} #[auto_test(...)] Usage Get ChatGPT API

Akira Moroo 429 Apr 15, 2023
A HTML to node macro powered by rstml.

html-node A HTML to node macro powered by rstml. Features Text escaping Pretty-printing NEW: type-safe elements and attributes! (example) Example let

Vidhan Bhatt 6 Jul 28, 2023
Macro to print variable(s) with values nicely (stripped from release builds)

log_macro Macro to print variable(s) with values nicely (stripped from release builds) Install cargo add log_macro Use Add this to top of file: #[mac

Nikita 3 Aug 22, 2023
Enhance Rust errors with file and line details using the `#[wherr]` macro for clearer debugging.

wherr Crate Discuss wherr on Hacker News Enhance Rust's ? operator by appending file and line number details to errors, simplifying the debugging proc

Joel Jakobsson 49 Sep 6, 2023
This library provides a convenient derive macro for the standard library's std::error::Error trait.

derive(Error) This library provides a convenient derive macro for the standard library's std::error::Error trait. [dependencies] therror = "1.0" Compi

Sebastian Thiel 5 Oct 23, 2023
A Rust macro for quickly unwrapping a refutable pattern.

unwrap_let! A Rust macro for quickly unwrapping a refutable pattern. Install Add unwrap_let to your dependency by running cargo add unwrap_let or edit

ChainLight 10 Nov 10, 2023
Just provide a macro for a certain programming language.

Trust me, this is safe! A macro wrap unsafe keyword into safe! macro. Always trust programmers. use std::alloc::{alloc, dealloc, Layout}; use trust_m

null 4 Dec 13, 2023