Skip to content

Commit 9a86be8

Browse files
committed
cargo fmt
1 parent 2a27a49 commit 9a86be8

15 files changed

+26
-26
lines changed

Configurations.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1300,13 +1300,12 @@ Reorder import statements in group
13001300
#### `false` (default):
13011301

13021302
```rust
1303-
use std::mem;
1304-
use std::io;
1305-
1306-
use lorem;
1307-
use ipsum;
13081303
use dolor;
1304+
use ipsum;
1305+
use lorem;
13091306
use sit;
1307+
use std::io;
1308+
use std::mem;
13101309
```
13111310

13121311
#### `true`:

src/bin/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ extern crate env_logger;
1414
extern crate getopts;
1515
extern crate rustfmt_nightly as rustfmt;
1616

17-
use std::{env, error};
1817
use std::fs::File;
1918
use std::io::{self, Read, Write};
2019
use std::path::{Path, PathBuf};
2120
use std::str::FromStr;
21+
use std::{env, error};
2222

2323
use getopts::{Matches, Options};
2424

25-
use rustfmt::{run, FileName, Input, Summary};
26-
use rustfmt::config::{get_toml_path, Color, Config, WriteMode};
2725
use rustfmt::config::file_lines::FileLines;
26+
use rustfmt::config::{get_toml_path, Color, Config, WriteMode};
27+
use rustfmt::{run, FileName, Input, Summary};
2828

2929
type FmtError = Box<error::Error + Send + Sync>;
3030
type FmtResult<T> = std::result::Result<T, FmtError>;

src/chains.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ use std::borrow::Cow;
7777
use std::cmp::min;
7878
use std::iter;
7979

80-
use syntax::{ast, ptr};
8180
use syntax::codemap::Span;
81+
use syntax::{ast, ptr};
8282

8383
pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -> Option<String> {
8484
debug!("rewrite_chain {:?}", shape);

src/closures.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// except according to those terms.
1010

1111
use config::lists::*;
12-
use syntax::{ast, ptr};
1312
use syntax::codemap::Span;
1413
use syntax::parse::classify;
14+
use syntax::{ast, ptr};
1515

1616
use codemap::SpanUtils;
1717
use expr::{block_contains_comment, is_simple_block, is_unsafe_block, rewrite_cond, ToExpr};

src/config/file_lines.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
//! This module contains types and functions to support formatting specific line ranges.
1212
13-
use std::{cmp, iter, str};
1413
use std::collections::HashMap;
1514
use std::rc::Rc;
15+
use std::{cmp, iter, str};
1616

1717
use serde::de::{Deserialize, Deserializer};
1818
use serde_json as json;

src/config/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::{env, fs};
1211
use std::cell::Cell;
1312
use std::default::Default;
1413
use std::fs::File;
1514
use std::io::{Error, ErrorKind, Read};
1615
use std::path::{Path, PathBuf};
16+
use std::{env, fs};
1717

1818
use regex::Regex;
1919

src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use std::cmp::min;
1313
use std::iter::repeat;
1414

1515
use config::lists::*;
16-
use syntax::{ast, ptr};
1716
use syntax::codemap::{BytePos, CodeMap, Span};
17+
use syntax::{ast, ptr};
1818

1919
use chains::rewrite_chain;
2020
use closures;

src/format-diff/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ extern crate regex;
2323
extern crate serde_derive;
2424
extern crate serde_json as json;
2525

26-
use std::{env, fmt, process};
2726
use std::collections::HashSet;
2827
use std::error::Error;
2928
use std::io::{self, BufRead};
29+
use std::{env, fmt, process};
3030

3131
use regex::Regex;
3232

src/items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use std::cmp::min;
1515

1616
use config::lists::*;
1717
use regex::Regex;
18-
use syntax::{abi, ast, ptr, symbol};
1918
use syntax::codemap::{self, BytePos, Span};
2019
use syntax::visit;
20+
use syntax::{abi, ast, ptr, symbol};
2121

2222
use codemap::{LineRangeUtils, SpanUtils};
2323
use comment::{combine_strs_with_missing_comments, contains_comment, recover_comment_removed,

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ use std::path::PathBuf;
3838
use std::rc::Rc;
3939
use std::time::Duration;
4040

41-
use syntax::errors::{DiagnosticBuilder, Handler};
42-
use syntax::errors::emitter::{ColorConfig, EmitterWriter};
4341
use syntax::ast;
44-
use syntax::codemap::{CodeMap, FilePathMapping};
4542
pub use syntax::codemap::FileName;
43+
use syntax::codemap::{CodeMap, FilePathMapping};
44+
use syntax::errors::{DiagnosticBuilder, Handler};
45+
use syntax::errors::emitter::{ColorConfig, EmitterWriter};
4646
use syntax::parse::{self, ParseSess};
4747

4848
use checkstyle::{output_footer, output_header};

src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use std::collections::HashMap;
2323

2424
use config::lists::*;
25-
use syntax::{ast, ptr};
2625
use syntax::codemap::{BytePos, Span};
2726
use syntax::parse::new_parser_from_tts;
2827
use syntax::parse::parser::Parser;
@@ -31,6 +30,7 @@ use syntax::print::pprust;
3130
use syntax::symbol;
3231
use syntax::tokenstream::{Cursor, ThinTokenStream, TokenStream, TokenTree};
3332
use syntax::util::ThinVec;
33+
use syntax::{ast, ptr};
3434

3535
use codemap::SpanUtils;
3636
use comment::{contains_comment, remove_trailing_white_spaces, FindUncommented};

src/rustfmt_diff.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ where
211211

212212
#[cfg(test)]
213213
mod test {
214-
use super::{make_diff, Mismatch};
215214
use super::DiffLine::*;
215+
use super::{make_diff, Mismatch};
216216

217217
#[test]
218218
fn diff_simple() {

src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
use std::borrow::Cow;
1212

13-
use syntax::{abi, ptr};
1413
use syntax::ast::{self, Attribute, CrateSugar, MetaItem, MetaItemKind, NestedMetaItem,
1514
NestedMetaItemKind, Path, Visibility, VisibilityKind};
1615
use syntax::codemap::{BytePos, Span, NO_EXPANSION};
16+
use syntax::{abi, ptr};
1717

1818
use config::Color;
1919
use rewrite::RewriteContext;

src/visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use syntax::{ast, visit};
1211
use syntax::attr::HasAttrs;
1312
use syntax::codemap::{self, BytePos, CodeMap, Pos, Span};
1413
use syntax::parse::ParseSess;
14+
use syntax::{ast, visit};
1515

1616
use attr::*;
1717
use codemap::{LineRangeUtils, SpanUtils};

tests/target/imports.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ fn test() {
4343
}
4444

4545
// Simple imports
46-
use foo::bar::baz;
4746
use bar::quux as kaas;
4847
use foo;
48+
use foo::bar::baz;
4949

5050
// With aliases.
51-
use foo::{self as bar, baz};
5251
use foo as bar;
5352
use foo::qux as bar;
53+
use foo::{self as bar, baz};
5454
use foo::{baz, qux as bar};
5555

5656
// With absolute paths
5757
use foo;
58+
use Foo;
5859
use foo::Bar;
5960
use foo::{Bar, Baz};
60-
use Foo;
6161
use {Bar, Baz};
6262

6363
// Root globs
@@ -83,6 +83,7 @@ use fooo::{bar, x, y, z,
8383
bar::*};
8484

8585
// nested imports with a single sub-tree.
86-
use a::b::c::*;
8786
use a::b::c::d;
87+
use a::b::c::*;
88+
8889
use a::b::c::{xxx, yyy, zzz};

0 commit comments

Comments
 (0)