format_static!
Nobody has claimed this yet.
- Dominant language
- Markdown
- Stars
- 6.6k
- Forks
- 1.7k
- Avg merge
- 16h 14m
- Merged PRs (30d)
- 1
Description
Between https://github.com/rust-lang/rust/pull/78837 and https://github.com/rust-lang/rust/pull/79150, we feel like a format_static!() macro would be useful. This would allow one to, for example:
#[doc = format_static!(include!("docs_for_foo.md"), $arg1, $arg2)]
or even just for replacing these occurrences of concat! with something more human-readable: https://github.com/rust-lang/rust/pull/79150/files#diff-28f62e401cacbc5959e8762c79a4e0417d52ab64b2cd4e19cafa0d9f7e1bbaeeR30
such that
#[doc = concat!("For example, `Option<", stringify!($Ty), ">` is the same size as `", stringify!($Int), "`:")]
becomes
#[doc = format_static!("For example, `Option<{}>` is the same size as `{}`:", stringify!($Ty), stringify!($Int))]
which doesn't require whoever is maintaining the thing to parse the stringify!() parts before being able to continue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read Rust PRs 78837 and 79150 first, especially the documented concat! and stringify! use cases. Determine the desired format_static! behavior and constraints from those examples; the work is complete when the macro's design and implementation requirements are specified clearly enough to evaluate or implement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100