From c28df858c79521dde6571a6fe153ba8af92f79d4 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Wed, 9 Aug 2017 00:16:35 +0900 Subject: [PATCH] Format source codes and update tests --- src/bin/rustfmt.rs | 4 ++-- src/lib.rs | 14 +++++--------- tests/source/extern.rs | 7 +++++++ tests/system.rs | 2 +- tests/target/attrib-extern-crate.rs | 4 ++-- tests/target/extern.rs | 9 ++++++++- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/bin/rustfmt.rs b/src/bin/rustfmt.rs index 2de572f616e..d1f7a83187b 100644 --- a/src/bin/rustfmt.rs +++ b/src/bin/rustfmt.rs @@ -11,11 +11,11 @@ #![cfg(not(test))] +extern crate env_logger; +extern crate getopts; extern crate log; extern crate rustfmt_nightly as rustfmt; extern crate toml; -extern crate env_logger; -extern crate getopts; use std::{env, error}; use std::fs::File; diff --git a/src/lib.rs b/src/lib.rs index e1017fab959..eaac371aa5b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,23 +10,19 @@ #![feature(rustc_private)] +extern crate diff; #[macro_use] extern crate log; - +extern crate regex; +extern crate rustc_errors as errors; extern crate serde; #[macro_use] extern crate serde_derive; extern crate serde_json; - -extern crate syntax; -extern crate rustc_errors as errors; - extern crate strings; - -extern crate unicode_segmentation; -extern crate regex; -extern crate diff; +extern crate syntax; extern crate term; +extern crate unicode_segmentation; use std::collections::HashMap; use std::fmt; diff --git a/tests/source/extern.rs b/tests/source/extern.rs index 7f14d27b779..5546b217226 100644 --- a/tests/source/extern.rs +++ b/tests/source/extern.rs @@ -3,6 +3,13 @@ extern crate foo ; extern crate foo as bar ; +extern crate futures; +extern crate dotenv; +extern crate chrono; + +extern crate foo; +extern crate bar; + extern "C" { fn c_func(x: *mut *mut libc::c_void); diff --git a/tests/system.rs b/tests/system.rs index d915e11d534..6e148147a48 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate rustfmt_nightly as rustfmt; extern crate diff; extern crate regex; +extern crate rustfmt_nightly as rustfmt; extern crate term; use std::collections::HashMap; diff --git a/tests/target/attrib-extern-crate.rs b/tests/target/attrib-extern-crate.rs index fe06195b154..ed64a0aeb07 100644 --- a/tests/target/attrib-extern-crate.rs +++ b/tests/target/attrib-extern-crate.rs @@ -1,17 +1,17 @@ // Attributes on extern crate. -extern crate Foo; #[Attr1] extern crate Bar; #[Attr2] #[Attr2] extern crate Baz; +extern crate Foo; fn foo() { - extern crate Foo; #[Attr1] extern crate Bar; #[Attr2] #[Attr2] extern crate Baz; + extern crate Foo; } diff --git a/tests/target/extern.rs b/tests/target/extern.rs index 1431c384db9..c0601a4d0e1 100644 --- a/tests/target/extern.rs +++ b/tests/target/extern.rs @@ -1,7 +1,14 @@ // rustfmt-normalize_comments: true -extern crate foo; extern crate foo as bar; +extern crate foo; + +extern crate chrono; +extern crate dotenv; +extern crate futures; + +extern crate bar; +extern crate foo; extern "C" { fn c_func(x: *mut *mut libc::c_void);