{"id":17609879,"url":"https://github.com/emmiegit/str-macro","last_synced_at":"2025-04-30T14:30:27.028Z","repository":{"id":52406272,"uuid":"182454791","full_name":"emmiegit/str-macro","owner":"emmiegit","description":"Rust str macro to bring the convenience of vec to the String type","archived":false,"fork":false,"pushed_at":"2022-07-10T22:38:22.000Z","size":22,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T18:03:22.761Z","etag":null,"topics":["macros","rust","string"],"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/emmiegit.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}},"created_at":"2019-04-20T21:11:46.000Z","updated_at":"2024-03-06T14:09:31.000Z","dependencies_parsed_at":"2022-08-28T18:12:04.020Z","dependency_job_id":null,"html_url":"https://github.com/emmiegit/str-macro","commit_stats":null,"previous_names":["ammongit/str-macro"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Fstr-macro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Fstr-macro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Fstr-macro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Fstr-macro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmiegit","download_url":"https://codeload.github.com/emmiegit/str-macro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251721381,"owners_count":21632827,"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":["macros","rust","string"],"created_at":"2024-10-22T17:10:28.007Z","updated_at":"2025-04-30T14:30:26.973Z","avatar_url":"https://github.com/emmiegit.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## str-macro\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/emmiegit/str-macro/actions?query=workflow%3A%22Rust+CI%22\"\u003e\n    \u003cimg src=\"https://github.com/emmiegit/str-macro/workflows/Rust%20CI/badge.svg\"\n         alt=\"Rust CI badge\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nRust crate for the `str!()` macro, which makes the conveniences available from `vec![]` available for `String` as well.\n\nHas no dependencies, and should work on any Rust release channel.\n\n* Create an empty `String`\n\n```rust\n// Vec equivalent\nlet v = vec![];\nassert_eq!(v, Vec::new());\nassert!(v.is_empty());\n\n// String\nlet s = str!();\nassert_eq!(s, String::new());\nassert!(s.is_empty());\n```\n\n* Create an owned `String` from a constant str reference.\n\n```rust\n// Vec equivalent\nlet v = vec![\"alpha\", \"beta\", \"gamma\"];\nassert_eq!(\u0026v, \u0026[\"alpha\", \"beta\", \"gamma\"];\nassert_eq!(v.len(), 3);\n\n// String\nlet s = str!(\"alpha beta gamma\");\nassert_eq!(\u0026s, \"alpha beta gamma\");\nlet _: String = s;\n```\n\n* Create an owned `String` from an object which implements `ToString`.\n\nNote that this is automatically implemented for anything that implements `Display`.\n\n```rust\nlet s = str!(2194);\nassert_eq!(\u0026s, \"2194\");\n\nlet s = str!(Ipv4Addr::new(127, 0, 0, 1));\nassert_eq!(\u0026s, \"127.0.0.1\");\n```\n\n----\n\nCopyright (C) 2019-2021 Ammon Smith\n\nAvailable under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmiegit%2Fstr-macro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmiegit%2Fstr-macro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmiegit%2Fstr-macro/lists"}