File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use std::env;
88use std:: fs:: File ;
99use std:: io:: prelude:: * ;
1010use std:: io:: BufWriter ;
11- use std:: path:: Path ;
11+ use std:: path:: { self , Path } ;
1212
1313use std:: collections:: BTreeMap ;
1414
@@ -19,12 +19,14 @@ mod mime_types;
1919
2020fn main ( ) {
2121 let out_dir = env:: var ( "OUT_DIR" ) . unwrap ( ) ;
22- let dest_path = Path :: new ( & out_dir) . join ( "mime_types_generated.rs" ) ;
22+ let mime_types_generated_filename = "mime_types_generated.rs" ;
23+ let dest_path = Path :: new ( & out_dir) . join ( mime_types_generated_filename) ;
2324 let mut outfile = BufWriter :: new ( File :: create ( & dest_path) . unwrap ( ) ) ;
2425
2526 println ! (
26- "cargo:rustc-env=MIME_TYPES_GENERATED_PATH={}" ,
27- dest_path. display( )
27+ "cargo:rustc-env=MIME_TYPES_GENERATED_PATH={separator}{filename}" ,
28+ separator = path:: MAIN_SEPARATOR ,
29+ filename = mime_types_generated_filename,
2830 ) ;
2931
3032 #[ cfg( feature = "phf" ) ]
Original file line number Diff line number Diff line change 11use unicase:: UniCase ;
22
33include ! ( "mime_types.rs" ) ;
4- include ! ( env!( "MIME_TYPES_GENERATED_PATH" ) ) ;
4+ include ! ( concat! ( env!( "OUT_DIR" ) , env! ( " MIME_TYPES_GENERATED_PATH") ) ) ;
55
66#[ cfg( feature = "rev-map" ) ]
77#[ derive( Copy , Clone ) ]
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ extern crate phf;
22
33use unicase:: UniCase ;
44
5- include ! ( env!( "MIME_TYPES_GENERATED_PATH" ) ) ;
5+ include ! ( concat! ( env!( "OUT_DIR" ) , env! ( " MIME_TYPES_GENERATED_PATH") ) ) ;
66
77#[ cfg( feature = "rev-map" ) ]
88struct TopLevelExts {
You can’t perform that action at this time.
0 commit comments