From 61f3a438d3a729a6be941bca1ff4c6a97a33f221 Mon Sep 17 00:00:00 2001 From: "Jeremy A. Kolb" Date: Mon, 15 Oct 2018 17:44:23 -0400 Subject: Cargo Format Run `cargo fmt` and ignore generated files --- crates/ra_cli/src/main.rs | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'crates/ra_cli/src') diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 11605cfd8..239d846b3 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -2,19 +2,17 @@ extern crate clap; #[macro_use] extern crate failure; extern crate join_to_string; -extern crate ra_syntax; extern crate ra_editor; +extern crate ra_syntax; extern crate tools; -use std::{ - fs, io::Read, path::Path, - time::Instant -}; +use std::{fs, io::Read, path::Path, time::Instant}; + use clap::{App, Arg, SubCommand}; use join_to_string::join; +use ra_editor::{extend_selection, file_structure, syntax_tree}; +use ra_syntax::{File, TextRange}; use tools::collect_tests; -use ra_syntax::{TextRange, File}; -use ra_editor::{syntax_tree, file_structure, extend_selection}; type Result = ::std::result::Result; @@ -36,14 +34,12 @@ fn main() -> Result<()> { .takes_value(true), ), ) - .subcommand( - SubCommand::with_name("parse") - .arg(Arg::with_name("no-dump").long("--no-dump")) - ) + .subcommand(SubCommand::with_name("parse").arg(Arg::with_name("no-dump").long("--no-dump"))) .subcommand(SubCommand::with_name("symbols")) - .subcommand(SubCommand::with_name("extend-selection") - .arg(Arg::with_name("start")) - .arg(Arg::with_name("end")) + .subcommand( + SubCommand::with_name("extend-selection") + .arg(Arg::with_name("start")) + .arg(Arg::with_name("end")), ) .get_matches(); match matches.subcommand() { @@ -116,7 +112,8 @@ fn selections(file: &File, start: u32, end: u32) -> String { ranges.push(r); cur = extend_selection(&file, r); } - let ranges = ranges.iter() + let ranges = ranges + .iter() .map(|r| (1 + u32::from(r.start()), 1 + u32::from(r.end()))) .map(|(s, e)| format!("({} {})", s, e)); join(ranges) -- cgit v1.2.3