Skip to content

Commit 10f5a36

Browse files
authored
Rollup merge of rust-lang#60521 - rasendubi:tidy-2018-edition, r=Centril
Migrate tidy to rust 2018 edition cc @Centril
2 parents 68dcca8 + bacf792 commit 10f5a36

File tree

6 files changed

+8
-17
lines changed

6 files changed

+8
-17
lines changed

Diff for: src/tools/tidy/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "tidy"
33
version = "0.1.0"
44
authors = ["Alex Crichton <alex@alexcrichton.com>"]
5+
edition = "2018"
56

67
[dependencies]
78
regex = "1"

Diff for: src/tools/tidy/src/deps.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::fs;
55
use std::path::Path;
66
use std::process::Command;
77

8+
use serde_derive::Deserialize;
89
use serde_json;
910

1011
const LICENSES: &[&str] = &[

Diff for: src/tools/tidy/src/features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::path::Path;
1818
use regex::{Regex, escape};
1919

2020
mod version;
21-
use self::version::Version;
21+
use version::Version;
2222

2323
const FEATURE_GROUP_START_PREFIX: &str = "// feature-group-start";
2424
const FEATURE_GROUP_END_PREFIX: &str = "// feature-group-end";

Diff for: src/tools/tidy/src/features/version.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ impl FromStr for Version {
3131
fn from_str(s: &str) -> Result<Self, Self::Err> {
3232
let mut iter = s.split('.').map(|part| Ok(part.parse()?));
3333

34-
let parts = {
35-
let mut part = || {
36-
iter.next()
37-
.unwrap_or(Err(ParseVersionError::WrongNumberOfParts))
38-
};
39-
40-
[part()?, part()?, part()?]
34+
let mut part = || {
35+
iter.next()
36+
.unwrap_or(Err(ParseVersionError::WrongNumberOfParts))
4137
};
4238

39+
let parts = [part()?, part()?, part()?];
40+
4341
if let Some(_) = iter.next() {
4442
// Ensure we don't have more than 3 parts.
4543
return Err(ParseVersionError::WrongNumberOfParts);

Diff for: src/tools/tidy/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
//! This library contains the tidy lints and exposes it
44
//! to be used by tools.
55
6-
#![deny(rust_2018_idioms)]
7-
8-
extern crate regex;
9-
extern crate serde_json;
10-
#[macro_use]
11-
extern crate serde_derive;
12-
136
use std::fs;
147

158
use std::path::Path;

Diff for: src/tools/tidy/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
//! etc. This is run by default on `make check` and as part of the auto
55
//! builders.
66
7-
#![deny(rust_2018_idioms)]
87
#![deny(warnings)]
98

10-
extern crate tidy;
119
use tidy::*;
1210

1311
use std::process;

0 commit comments

Comments
 (0)