about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/main.rs8
-rw-r--r--src/cargo-fmt/main.rs6
-rw-r--r--src/format-diff/main.rs8
-rw-r--r--src/git-rustfmt/main.rs6
-rw-r--r--src/lib.rs16
5 files changed, 14 insertions, 30 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs
index 53e95e8b5b6..b357eed34cf 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern crate env_logger;
+use env_logger;
 #[macro_use]
 extern crate failure;
-extern crate getopts;
-extern crate rustfmt_nightly as rustfmt;
+
+use rustfmt_nightly as rustfmt;
 
 use std::env;
 use std::fs::File;
@@ -296,7 +296,7 @@ fn format(
     Ok(exit_code)
 }
 
-fn format_and_emit_report<T: Write>(session: &mut Session<T>, input: Input) {
+fn format_and_emit_report<T: Write>(session: &mut Session<'_, T>, input: Input) {
     match session.format(input) {
         Ok(report) => {
             if report.has_warnings() {
diff --git a/src/cargo-fmt/main.rs b/src/cargo-fmt/main.rs
index 83a93240ff2..05861743963 100644
--- a/src/cargo-fmt/main.rs
+++ b/src/cargo-fmt/main.rs
@@ -13,9 +13,9 @@
 #![cfg(not(test))]
 #![deny(warnings)]
 
-extern crate cargo_metadata;
-extern crate getopts;
-extern crate serde_json as json;
+use cargo_metadata;
+use getopts;
+
 
 use std::collections::{HashMap, HashSet};
 use std::env;
diff --git a/src/format-diff/main.rs b/src/format-diff/main.rs
index aacfa12d437..5ffff79811c 100644
--- a/src/format-diff/main.rs
+++ b/src/format-diff/main.rs
@@ -14,16 +14,16 @@
 
 #![deny(warnings)]
 
-extern crate env_logger;
+use env_logger;
 #[macro_use]
 extern crate failure;
-extern crate getopts;
+use getopts;
 #[macro_use]
 extern crate log;
-extern crate regex;
+use regex;
 #[macro_use]
 extern crate serde_derive;
-extern crate serde_json as json;
+use serde_json as json;
 
 use std::collections::HashSet;
 use std::io::{self, BufRead};
diff --git a/src/git-rustfmt/main.rs b/src/git-rustfmt/main.rs
index f7a181c4b6c..aae81ba3270 100644
--- a/src/git-rustfmt/main.rs
+++ b/src/git-rustfmt/main.rs
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern crate env_logger;
-extern crate getopts;
+use env_logger;
+
 #[macro_use]
 extern crate log;
-extern crate rustfmt_nightly as rustfmt;
+use rustfmt_nightly as rustfmt;
 
 use std::env;
 use std::io::stdout;
diff --git a/src/lib.rs b/src/lib.rs
index 6fc3dc85945..799aad90b7b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,29 +10,13 @@
 
 #[macro_use]
 extern crate derive_new;
-extern crate atty;
-extern crate bytecount;
-extern crate diff;
-extern crate dirs;
-extern crate failure;
-extern crate itertools;
 #[cfg(test)]
 #[macro_use]
 extern crate lazy_static;
 #[macro_use]
 extern crate log;
-extern crate regex;
-extern crate rustc_target;
-extern crate serde;
 #[macro_use]
 extern crate serde_derive;
-extern crate serde_json;
-extern crate syntax;
-extern crate syntax_pos;
-extern crate toml;
-extern crate unicode_categories;
-extern crate unicode_segmentation;
-extern crate unicode_width;
 
 use std::cell::RefCell;
 use std::collections::HashMap;