Benign rust 153,106 installs Download

rspack_macros 0.102.9

“rspack macros”

Large registry install base (10k+ downloads)Package is at least one year old
SHA-2560157a556a2a74f542345e86f65debf8ba55f9c406f03e7b87c276490efeaa570
MaleculeO(S)H(Db)Md

Evidence

imports cow_utils::CowUtils string_enum.rs · lines 1–13
1use cow_utils::CowUtils;
2use heck::ToSnakeCase;
3use proc_macro2::TokenStream;
4use quote::quote;
5use syn::{Data, DeriveInput, Error, Fields, LitStr, Result, spanned::Spanned};
6
7enum Fallback {
⋯6 lines
English function-word token "for" string_enum.rs · lines 73–80
73:11… t.span(),
74 "StringEnum can only be derived for enums",
75 ));
76 };
⋯4 lines
Rust replaces matched string content string_enum.rs · lines 142–155
142:75… y one unnamed field",
143 ));
144 }
145 };
146 if fallback.replace(fallback_variant).is_some() {
147 return Err(Error::new(
148 variant.span(),
149 "string enum must have exactly one fallback variant",
150 ));
151 }
⋯4 lines
English function-word token "the" lib.rs · lines 57–67
⋯5 lines
62}
63
64/// Derives `as_str` and `From<&str>` for a string enum.
65///
66/// Variant names use `snake_case` by default. Use `#[string_enum(rename_all = "...")]` on the enum
67/// to select a serde-style rename rule, or `#[string_enum(rename = "...")]` on a variant …
English function-word token "that" lib.rs · lines 68–72
68:2… // override its value. Mark exactly one variant with `#[string_enum(fallback)]` for unknown
69/// strings. The fallback may be a unit variant or a newtype variant that can store the unknown
70/// string.
71#[proc_macro_derive(StringEnum, attributes(string_enum))]
72pub …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.