Skip to content

Commit c28df85

Browse files
committed
Format source codes and update tests
1 parent 7bf9aa2 commit c28df85

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

src/bin/rustfmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#![cfg(not(test))]
1212

1313

14+
extern crate env_logger;
15+
extern crate getopts;
1416
extern crate log;
1517
extern crate rustfmt_nightly as rustfmt;
1618
extern crate toml;
17-
extern crate env_logger;
18-
extern crate getopts;
1919

2020
use std::{env, error};
2121
use std::fs::File;

src/lib.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,19 @@
1010

1111
#![feature(rustc_private)]
1212

13+
extern crate diff;
1314
#[macro_use]
1415
extern crate log;
15-
16+
extern crate regex;
17+
extern crate rustc_errors as errors;
1618
extern crate serde;
1719
#[macro_use]
1820
extern crate serde_derive;
1921
extern crate serde_json;
20-
21-
extern crate syntax;
22-
extern crate rustc_errors as errors;
23-
2422
extern crate strings;
25-
26-
extern crate unicode_segmentation;
27-
extern crate regex;
28-
extern crate diff;
23+
extern crate syntax;
2924
extern crate term;
25+
extern crate unicode_segmentation;
3026

3127
use std::collections::HashMap;
3228
use std::fmt;

tests/source/extern.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
extern crate foo ;
44
extern crate foo as bar ;
55

6+
extern crate futures;
7+
extern crate dotenv;
8+
extern crate chrono;
9+
10+
extern crate foo;
11+
extern crate bar;
12+
613
extern "C" {
714
fn c_func(x: *mut *mut libc::c_void);
815

tests/system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern crate rustfmt_nightly as rustfmt;
1211
extern crate diff;
1312
extern crate regex;
13+
extern crate rustfmt_nightly as rustfmt;
1414
extern crate term;
1515

1616
use std::collections::HashMap;

tests/target/attrib-extern-crate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Attributes on extern crate.
22

3-
extern crate Foo;
43
#[Attr1]
54
extern crate Bar;
65
#[Attr2]
76
#[Attr2]
87
extern crate Baz;
8+
extern crate Foo;
99

1010
fn foo() {
11-
extern crate Foo;
1211
#[Attr1]
1312
extern crate Bar;
1413
#[Attr2]
1514
#[Attr2]
1615
extern crate Baz;
16+
extern crate Foo;
1717
}

tests/target/extern.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
// rustfmt-normalize_comments: true
22

3-
extern crate foo;
43
extern crate foo as bar;
4+
extern crate foo;
5+
6+
extern crate chrono;
7+
extern crate dotenv;
8+
extern crate futures;
9+
10+
extern crate bar;
11+
extern crate foo;
512

613
extern "C" {
714
fn c_func(x: *mut *mut libc::c_void);

0 commit comments

Comments
 (0)