11
11
// This builds a program that is run on the compilation host before the code is compiled. It can
12
12
// output configuration settings that affect the compilation.
13
13
14
- use std:: io:: { BufRead , BufReader , Write } ;
15
14
use std:: env;
16
15
use std:: fs:: File ;
16
+ use std:: io:: { BufRead , BufReader , Write } ;
17
17
use std:: path:: Path ;
18
18
19
19
use regex:: Regex ;
@@ -31,7 +31,7 @@ pub fn export_bool_kconfig() {
31
31
32
32
let file = File :: open ( & dotconfig) . expect ( "Unable to open dotconfig" ) ;
33
33
for line in BufReader :: new ( file) . lines ( ) {
34
- let line = line. expect ( "reading line from dotconfig" ) ;
34
+ let line = line. expect ( "reading line from dotconfig" ) ;
35
35
if let Some ( caps) = config_y. captures ( & line) {
36
36
println ! ( "cargo:rustc-cfg={}" , & caps[ 1 ] ) ;
37
37
}
@@ -60,16 +60,18 @@ pub fn build_kconfig_mod() {
60
60
let line = line. expect ( "reading line from dotconfig" ) ;
61
61
if let Some ( caps) = config_hex. captures ( & line) {
62
62
writeln ! ( & mut f, "#[allow(dead_code)]" ) . unwrap ( ) ;
63
- writeln ! ( & mut f, "pub const {}: usize = {};" ,
64
- & caps[ 1 ] , & caps[ 2 ] ) . unwrap ( ) ;
63
+ writeln ! ( & mut f, "pub const {}: usize = {};" , & caps[ 1 ] , & caps[ 2 ] ) . unwrap ( ) ;
65
64
} else if let Some ( caps) = config_int. captures ( & line) {
66
65
writeln ! ( & mut f, "#[allow(dead_code)]" ) . unwrap ( ) ;
67
- writeln ! ( & mut f, "pub const {}: isize = {};" ,
68
- & caps[ 1 ] , & caps[ 2 ] ) . unwrap ( ) ;
66
+ writeln ! ( & mut f, "pub const {}: isize = {};" , & caps[ 1 ] , & caps[ 2 ] ) . unwrap ( ) ;
69
67
} else if let Some ( caps) = config_str. captures ( & line) {
70
68
writeln ! ( & mut f, "#[allow(dead_code)]" ) . unwrap ( ) ;
71
- writeln ! ( & mut f, "pub const {}: &'static str = {};" ,
72
- & caps[ 1 ] , & caps[ 2 ] ) . unwrap ( ) ;
69
+ writeln ! (
70
+ & mut f,
71
+ "pub const {}: &'static str = {};" ,
72
+ & caps[ 1 ] , & caps[ 2 ]
73
+ )
74
+ . unwrap ( ) ;
73
75
}
74
76
}
75
77
}
0 commit comments