File tree Expand file tree Collapse file tree 6 files changed +8
-17
lines changed Expand file tree Collapse file tree 6 files changed +8
-17
lines changed Original file line number Diff line number Diff line change 22name = " tidy"
33version = " 0.1.0"
44authors = [" Alex Crichton <alex@alexcrichton.com>" ]
5+ edition = " 2018"
56
67[dependencies ]
78regex = " 1"
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use std::fs;
55use std:: path:: Path ;
66use std:: process:: Command ;
77
8+ use serde_derive:: Deserialize ;
89use serde_json;
910
1011const LICENSES : & [ & str ] = & [
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ use std::path::Path;
1818use regex:: { Regex , escape} ;
1919
2020mod version;
21- use self :: version:: Version ;
21+ use version:: Version ;
2222
2323const FEATURE_GROUP_START_PREFIX : & str = "// feature-group-start" ;
2424const FEATURE_GROUP_END_PREFIX : & str = "// feature-group-end" ;
Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff line change 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-
136use std:: fs;
147
158use std:: path:: Path ;
Original file line number Diff line number Diff line change 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;
119use tidy:: * ;
1210
1311use std:: process;
You can’t perform that action at this time.
0 commit comments