dtolnay / dtolnay/prettyplease

`quote`-compatible example

Open
#61 2 comments 12 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
772
Forks
48
PR merge metrics
No merged PRs in 30d

Description

I think it would be very valuable to have an example in the root documentation showing how to use with the `quote` crate.

Something like this:

```rust
fn main() {
let rust_snippet = quote!{
fn hello_world() {println!("hello world !")}
};

let abstract_file : File = syn::parse2(rust_snippet);
let pretty_rust = prettyplease::unparse(abstract_file);

println!(pretty_rust);
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the root documentation and checking how examples and dependencies are currently presented. Add a quote-compatible usage example based on the issue's snippet, then verify that the example matches the documented API and builds or otherwise renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.