Skip to content

Commit c0f93a6

Browse files
committed
cargo +nightly fix --edition-idioms
1 parent e28fae9 commit c0f93a6

File tree

5 files changed

+14
-30
lines changed

5 files changed

+14
-30
lines changed

src/bin/main.rs

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

11-
extern crate env_logger;
11+
use env_logger;
1212
#[macro_use]
1313
extern crate failure;
14-
extern crate getopts;
15-
extern crate rustfmt_nightly as rustfmt;
14+
15+
use rustfmt_nightly as rustfmt;
1616

1717
use std::env;
1818
use std::fs::File;
@@ -296,7 +296,7 @@ fn format(
296296
Ok(exit_code)
297297
}
298298

299-
fn format_and_emit_report<T: Write>(session: &mut Session<T>, input: Input) {
299+
fn format_and_emit_report<T: Write>(session: &mut Session<'_, T>, input: Input) {
300300
match session.format(input) {
301301
Ok(report) => {
302302
if report.has_warnings() {

src/cargo-fmt/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#![cfg(not(test))]
1414
#![deny(warnings)]
1515

16-
extern crate cargo_metadata;
17-
extern crate getopts;
18-
extern crate serde_json as json;
16+
use cargo_metadata;
17+
use getopts;
18+
1919

2020
use std::collections::{HashMap, HashSet};
2121
use std::env;

src/format-diff/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414

1515
#![deny(warnings)]
1616

17-
extern crate env_logger;
17+
use env_logger;
1818
#[macro_use]
1919
extern crate failure;
20-
extern crate getopts;
20+
use getopts;
2121
#[macro_use]
2222
extern crate log;
23-
extern crate regex;
23+
use regex;
2424
#[macro_use]
2525
extern crate serde_derive;
26-
extern crate serde_json as json;
26+
use serde_json as json;
2727

2828
use std::collections::HashSet;
2929
use std::io::{self, BufRead};

src/git-rustfmt/main.rs

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

11-
extern crate env_logger;
12-
extern crate getopts;
11+
use env_logger;
12+
1313
#[macro_use]
1414
extern crate log;
15-
extern crate rustfmt_nightly as rustfmt;
15+
use rustfmt_nightly as rustfmt;
1616

1717
use std::env;
1818
use std::io::stdout;

src/lib.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,13 @@
1010

1111
#[macro_use]
1212
extern crate derive_new;
13-
extern crate atty;
14-
extern crate bytecount;
15-
extern crate diff;
16-
extern crate dirs;
17-
extern crate failure;
18-
extern crate itertools;
1913
#[cfg(test)]
2014
#[macro_use]
2115
extern crate lazy_static;
2216
#[macro_use]
2317
extern crate log;
24-
extern crate regex;
25-
extern crate rustc_target;
26-
extern crate serde;
2718
#[macro_use]
2819
extern crate serde_derive;
29-
extern crate serde_json;
30-
extern crate syntax;
31-
extern crate syntax_pos;
32-
extern crate toml;
33-
extern crate unicode_categories;
34-
extern crate unicode_segmentation;
35-
extern crate unicode_width;
3620

3721
use std::cell::RefCell;
3822
use std::collections::HashMap;

0 commit comments

Comments
 (0)