{"id":26601361,"url":"https://github.com/calebwin/derive_lit","last_synced_at":"2025-03-23T18:39:33.369Z","repository":{"id":57618136,"uuid":"218141442","full_name":"calebwin/derive_lit","owner":"calebwin","description":"a tool to auto-generate literal macros for your data structure","archived":false,"fork":false,"pushed_at":"2019-10-28T20:55:54.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T07:15:46.939Z","etag":null,"topics":["data-structures","macro","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calebwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-28T20:42:05.000Z","updated_at":"2019-10-28T20:55:56.000Z","dependencies_parsed_at":"2022-09-15T20:51:09.936Z","dependency_job_id":null,"html_url":"https://github.com/calebwin/derive_lit","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/calebwin%2Fderive_lit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebwin%2Fderive_lit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebwin%2Fderive_lit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebwin%2Fderive_lit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calebwin","download_url":"https://codeload.github.com/calebwin/derive_lit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245152627,"owners_count":20569395,"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":["data-structures","macro","rust"],"created_at":"2025-03-23T18:39:32.727Z","updated_at":"2025-03-23T18:39:33.364Z","avatar_url":"https://github.com/calebwin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `derive_lit`\n\n[![](http://meritbadge.herokuapp.com/derive_lit)](https://crates.io/crates/derive_lit)\n[![](https://docs.rs/derive_lit/badge.svg)](https://docs.rs/derive_lit)\n\nAre you developing a data structure?\n\n```rust\nstruct GroceryList {\n\tnum_items: usize,\n\titem_ids: Vec\u003cusize\u003e\n}\n```\n\nAnd your data structure lets you add data to it?\n\n```rust\nimpl GroceryList {\n\tfn new() -\u003e Self {\n\t\tSelf {\n\t\t\tnum_items: 0,\n\t\t\titem_ids: vec![]\n\t\t}\n\t}\n\n\tfn push(\u0026mut self, item_id: usize) {\n\t\tself.item_ids.push(item_id);\n\t}\n}\n```\n\nWouldn't it be cool if you could do this?\n\n```rust\nfn main() {\n\tlet groceries = grocery_list![\n\t\t0,\n\t\t9,\n\t\t8,\n\t\t4\n\t];\n\n\t// do something intersting with your GroceryList...\n}\n```\n\nWhat if you could just...\n\n```rust\nuse derive_lit::VecLit;\n\n#[derive(VecLit)]\nstruct GroceryList {\n\tnum_items: usize,\n\titem_ids: Vec\u003cusize\u003e\n}\n```\n\nYou can! Use `derive_lit::*`.\nJust a `derive_lit = \"0.1.0\"` away!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebwin%2Fderive_lit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalebwin%2Fderive_lit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebwin%2Fderive_lit/lists"}