diff options
author | Jeremy A. Kolb <[email protected]> | 2018-10-15 22:44:23 +0100 |
---|---|---|
committer | Jeremy A. Kolb <[email protected]> | 2018-10-16 14:41:10 +0100 |
commit | 61f3a438d3a729a6be941bca1ff4c6a97a33f221 (patch) | |
tree | 6551967cc8c6e921b66071453ad7888a9121d326 /crates/ra_cli | |
parent | 39cb6c6d3f78b193f5873c3492e530bbd24d5dd2 (diff) |
Cargo Format
Run `cargo fmt` and ignore generated files
Diffstat (limited to 'crates/ra_cli')
-rw-r--r-- | crates/ra_cli/src/main.rs | 27 |
1 files changed, 12 insertions, 15 deletions
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; | |||
2 | #[macro_use] | 2 | #[macro_use] |
3 | extern crate failure; | 3 | extern crate failure; |
4 | extern crate join_to_string; | 4 | extern crate join_to_string; |
5 | extern crate ra_syntax; | ||
6 | extern crate ra_editor; | 5 | extern crate ra_editor; |
6 | extern crate ra_syntax; | ||
7 | extern crate tools; | 7 | extern crate tools; |
8 | 8 | ||
9 | use std::{ | 9 | use std::{fs, io::Read, path::Path, time::Instant}; |
10 | fs, io::Read, path::Path, | 10 | |
11 | time::Instant | ||
12 | }; | ||
13 | use clap::{App, Arg, SubCommand}; | 11 | use clap::{App, Arg, SubCommand}; |
14 | use join_to_string::join; | 12 | use join_to_string::join; |
13 | use ra_editor::{extend_selection, file_structure, syntax_tree}; | ||
14 | use ra_syntax::{File, TextRange}; | ||
15 | use tools::collect_tests; | 15 | use tools::collect_tests; |
16 | use ra_syntax::{TextRange, File}; | ||
17 | use ra_editor::{syntax_tree, file_structure, extend_selection}; | ||
18 | 16 | ||
19 | type Result<T> = ::std::result::Result<T, failure::Error>; | 17 | type Result<T> = ::std::result::Result<T, failure::Error>; |
20 | 18 | ||
@@ -36,14 +34,12 @@ fn main() -> Result<()> { | |||
36 | .takes_value(true), | 34 | .takes_value(true), |
37 | ), | 35 | ), |
38 | ) | 36 | ) |
39 | .subcommand( | 37 | .subcommand(SubCommand::with_name("parse").arg(Arg::with_name("no-dump").long("--no-dump"))) |
40 | SubCommand::with_name("parse") | ||
41 | .arg(Arg::with_name("no-dump").long("--no-dump")) | ||
42 | ) | ||
43 | .subcommand(SubCommand::with_name("symbols")) | 38 | .subcommand(SubCommand::with_name("symbols")) |
44 | .subcommand(SubCommand::with_name("extend-selection") | 39 | .subcommand( |
45 | .arg(Arg::with_name("start")) | 40 | SubCommand::with_name("extend-selection") |
46 | .arg(Arg::with_name("end")) | 41 | .arg(Arg::with_name("start")) |
42 | .arg(Arg::with_name("end")), | ||
47 | ) | 43 | ) |
48 | .get_matches(); | 44 | .get_matches(); |
49 | match matches.subcommand() { | 45 | match matches.subcommand() { |
@@ -116,7 +112,8 @@ fn selections(file: &File, start: u32, end: u32) -> String { | |||
116 | ranges.push(r); | 112 | ranges.push(r); |
117 | cur = extend_selection(&file, r); | 113 | cur = extend_selection(&file, r); |
118 | } | 114 | } |
119 | let ranges = ranges.iter() | 115 | let ranges = ranges |
116 | .iter() | ||
120 | .map(|r| (1 + u32::from(r.start()), 1 + u32::from(r.end()))) | 117 | .map(|r| (1 + u32::from(r.start()), 1 + u32::from(r.end()))) |
121 | .map(|(s, e)| format!("({} {})", s, e)); | 118 | .map(|(s, e)| format!("({} {})", s, e)); |
122 | join(ranges) | 119 | join(ranges) |