{"id":16410373,"url":"https://github.com/ctrlcctrlv/enum_for_matches","last_synced_at":"2025-07-09T04:01:53.697Z","repository":{"id":148743194,"uuid":"294375226","full_name":"ctrlcctrlv/enum_for_matches","owner":"ctrlcctrlv","description":"`enum_for_matches` runs a match arm for each enum variant passed into it regardless of type. It's a Rust procedural macro.","archived":false,"fork":false,"pushed_at":"2020-09-20T18:11:14.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-18T06:13:45.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctrlcctrlv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-10T10:17:08.000Z","updated_at":"2022-01-29T21:36:57.000Z","dependencies_parsed_at":"2024-03-25T06:46:42.098Z","dependency_job_id":null,"html_url":"https://github.com/ctrlcctrlv/enum_for_matches","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlcctrlv%2Fenum_for_matches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlcctrlv%2Fenum_for_matches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlcctrlv%2Fenum_for_matches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlcctrlv%2Fenum_for_matches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctrlcctrlv","download_url":"https://codeload.github.com/ctrlcctrlv/enum_for_matches/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240405241,"owners_count":19796154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T06:24:07.818Z","updated_at":"2025-02-24T02:24:42.300Z","avatar_url":"https://github.com/ctrlcctrlv.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `enum_for_matches`\n\n`enum_for_matches` runs a match arm for each enum variant passed into it\nregardless of type. So, you can make a string out of an enum which wraps\nnumeric types individually, such as `serde_value::Value` for example. See\nREADME.md on GitHub for more information.\n\nFor example, this:\n\n```rust\nenum TestEnum {\n    I64(i64),\n    U64(u64)\n}\n\nlet e = TestEnum::I64(80);\nlet mut s = String::new();\n\nenum_for_matches::run!(e, {TestEnum::I64(i) | TestEnum::U64(i)}, {s = i.to_string();});\neprintln!(\"{}\", \u0026s);\n```\n\nWould expand to:\n\n```rust\nmatch e\n{\n    TestEnum::I64(i) =\u003e { s = i.to_string(); }\n    TestEnum::U64(i) =\u003e { s = i.to_string(); } \n    _ =\u003e { }\n}\n```\n\nAnd print `80`.\n\n## Contributing\n\nThis crate is considered feature complete. It uses a copious amount of\n`.clone()`'s, many of which are probably removable. However, since this only\nruns at compile time, on probably quite small vectors, I couldn't be bothered.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrlcctrlv%2Fenum_for_matches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctrlcctrlv%2Fenum_for_matches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrlcctrlv%2Fenum_for_matches/lists"}