rust/crates/rust-analyzer/src/cli/symbols.rs
Yuri Astrakhan e16c76e3c3 Inline all format arguments where possible
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.

The change was automatically created with, so there are far less change
of an accidental typo.

```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00

17 lines
445 B
Rust

//! Read Rust code on stdin, print syntax tree on stdout.
use ide::Analysis;
use crate::cli::{flags, read_stdin};
impl flags::Symbols {
pub fn run(self) -> anyhow::Result<()> {
let text = read_stdin()?;
let (analysis, file_id) = Analysis::from_single_file(text);
let structure = analysis.file_structure(file_id).unwrap();
for s in structure {
println!("{s:?}");
}
Ok(())
}
}