{"id":17835695,"url":"https://github.com/rob2309/ct-for-rs","last_synced_at":"2025-04-02T13:11:47.190Z","repository":{"id":57614481,"uuid":"459942859","full_name":"Rob2309/ct-for-rs","owner":"Rob2309","description":"Macro for repeating code several times with substitutions","archived":false,"fork":false,"pushed_at":"2022-12-30T09:29:07.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T00:47:10.187Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rob2309.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-16T09:50:40.000Z","updated_at":"2023-04-11T15:45:07.000Z","dependencies_parsed_at":"2023-01-31T11:01:45.629Z","dependency_job_id":null,"html_url":"https://github.com/Rob2309/ct-for-rs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob2309%2Fct-for-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob2309%2Fct-for-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob2309%2Fct-for-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob2309%2Fct-for-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rob2309","download_url":"https://codeload.github.com/Rob2309/ct-for-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246819785,"owners_count":20839095,"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-27T20:24:25.885Z","updated_at":"2025-04-02T13:11:47.166Z","avatar_url":"https://github.com/Rob2309.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ct-for\r\n\r\n![license](https://img.shields.io/crates/l/ct-for?style=for-the-badge)\r\n[![crates.io](https://img.shields.io/crates/v/ct-for?style=for-the-badge)](https://crates.io/crates/ct-for)\r\n[![ci](https://img.shields.io/github/actions/workflow/status/rob2309/ct-for-rs/ci.yaml?label=CI\u0026style=for-the-badge)](https://github.com/Rob2309/ct-for-rs/actions/workflows/ci.yaml)\r\n[![docs.rs](https://img.shields.io/docsrs/ct-for?style=for-the-badge)](https://docs.rs/ct-for)\r\n\r\nThis crate exposes the `ct-for!()` macro, which can be used to repeat code `n` times with a substitution.\r\n\r\nFor example:\r\n```rust\r\nlet c = 17;\r\nct_for!(x in [\"5\", 6, c, vec![5, 6, 7]] do\r\n    println!(\"{:?}\", x);\r\n);\r\n```\r\nexpands to:\r\n```rust\r\nlet c = 17;\r\nprintln!(\"{:?}\", \"5\");\r\nprintln!(\"{:?}\", 6);\r\nprintln!(\"{:?}\", c);\r\nprintln!(\"{:?}\", vec![5, 6, 7]);\r\n```\r\n\r\nThe `ct_for!()` macro can also be nested.\r\n\r\nThere really isn't much more to it.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob2309%2Fct-for-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frob2309%2Fct-for-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob2309%2Fct-for-rs/lists"}