{"id":21586084,"url":"https://github.com/magiclen/concat-with","last_synced_at":"2025-04-10T20:20:26.351Z","repository":{"id":38840157,"uuid":"268881508","full_name":"magiclen/concat-with","owner":"magiclen","description":"Extend the function of the `concat!` macro in `std`.","archived":false,"fork":false,"pushed_at":"2023-11-30T03:29:35.000Z","size":23,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T17:55:20.817Z","etag":null,"topics":["concat","rust"],"latest_commit_sha":null,"homepage":"","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/magiclen.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-02T18:44:17.000Z","updated_at":"2021-10-16T03:52:19.000Z","dependencies_parsed_at":"2024-11-24T18:01:16.226Z","dependency_job_id":null,"html_url":"https://github.com/magiclen/concat-with","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"4342b68e4514c90bc1831534be33721a66bd0da0"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fconcat-with","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fconcat-with/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fconcat-with/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fconcat-with/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclen","download_url":"https://codeload.github.com/magiclen/concat-with/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248289809,"owners_count":21078921,"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":["concat","rust"],"created_at":"2024-11-24T15:12:38.430Z","updated_at":"2025-04-10T20:20:26.335Z","avatar_url":"https://github.com/magiclen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Concat With\n====================\n\n[![CI](https://github.com/magiclen/concat-with/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/concat-with/actions/workflows/ci.yml)\n\nWhile the `concat!` macro in `std` is useful to create a static string slice (`\u0026'static str`) from literals, it cannot set a separator for those. This crate therefore provides another `concat!` macro to deal with that situation.\n\n```rust\nassert_eq!(\"test10btrue\", concat_with::concat!(\"test\", 10, 'b', true));\nassert_eq!(\"test, 10, b, true\", concat_with::concat!(with \", \", \"test\", 10, 'b', true));\nassert_eq!(\"test\\n10\\nb\\ntrue\", concat_with::concat_line!(\"test\", 10, 'b', true));\n```\n\nPrefixes and suffixes can also be added.\n\n```rust\nassert_eq!(\"Someone says: Hello.\\nSomeone says: Nice to meet you!\", concat_with::concat_line!(prefix \"Someone says: \", \"Hello.\", \"Nice to meet you!\"));\n```\n\n## Create Your Own Macros\n\nThe `concat_impl!` macro can be used to create your own macros like `concat_line!` which concatenates literals separated by a specific literal.\n\n```rust\n#[doc(hidden)]\npub use concat_with::{concat, concat_impl}; // re-export `concat!` and `concat_impl!` if your custom macros use `#[macro_export]`\n\nconcat_impl! {\n    #[macro_export]\n    /// Concatenates literals into a static string slice separated by a comma and a whitespace, `, `. Prefixes and suffixes can also be added.\n    concat_with_comma =\u003e \", \",\n    #[macro_export]\n    /// Concatenates literals into a static string slice separated by a colon, `:`. Prefixes and suffixes can also be added.\n    concat_with_colon =\u003e ':',\n}\n\nassert_eq!(\"test, 10, b, true\", concat_with_comma!(\"test\", 10, 'b', true));\nassert_eq!(\"test:10:b:true\", concat_with_colon!(\"test\", 10, 'b', true));\n```\n\n## Crates.io\n\nhttps://crates.io/crates/concat-with\n\n## Documentation\n\nhttps://docs.rs/concat-with\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fconcat-with","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclen%2Fconcat-with","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fconcat-with/lists"}