File tree Expand file tree Collapse file tree 2 files changed +21
-25
lines changed Expand file tree Collapse file tree 2 files changed +21
-25
lines changed Original file line number Diff line number Diff line change @@ -1310,30 +1310,6 @@ impl schema::TomlManifest {
1310
1310
}
1311
1311
Ok ( patch)
1312
1312
}
1313
-
1314
- /// Returns the path to the build script if one exists for this crate.
1315
- fn maybe_custom_build (
1316
- & self ,
1317
- build : & Option < schema:: StringOrBool > ,
1318
- package_root : & Path ,
1319
- ) -> Option < PathBuf > {
1320
- let build_rs = package_root. join ( "build.rs" ) ;
1321
- match * build {
1322
- // Explicitly no build script.
1323
- Some ( schema:: StringOrBool :: Bool ( false ) ) => None ,
1324
- Some ( schema:: StringOrBool :: Bool ( true ) ) => Some ( build_rs) ,
1325
- Some ( schema:: StringOrBool :: String ( ref s) ) => Some ( PathBuf :: from ( s) ) ,
1326
- None => {
1327
- // If there is a `build.rs` file next to the `Cargo.toml`, assume it is
1328
- // a build script.
1329
- if build_rs. is_file ( ) {
1330
- Some ( build_rs)
1331
- } else {
1332
- None
1333
- }
1334
- }
1335
- }
1336
- }
1337
1313
}
1338
1314
1339
1315
struct Context < ' a , ' b > {
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ pub(super) fn targets(
105
105
) ?) ;
106
106
107
107
// processing the custom build script
108
- if let Some ( custom_build) = manifest . maybe_custom_build ( custom_build, package_root) {
108
+ if let Some ( custom_build) = maybe_custom_build ( custom_build, package_root) {
109
109
if metabuild. is_some ( ) {
110
110
anyhow:: bail!( "cannot specify both `metabuild` and `build`" ) ;
111
111
}
@@ -964,3 +964,23 @@ Cargo doesn't know which to use because multiple target files found at `{}` and
964
964
( None , Some ( _) ) => unreachable ! ( ) ,
965
965
}
966
966
}
967
+
968
+ /// Returns the path to the build script if one exists for this crate.
969
+ fn maybe_custom_build ( build : & Option < StringOrBool > , package_root : & Path ) -> Option < PathBuf > {
970
+ let build_rs = package_root. join ( "build.rs" ) ;
971
+ match * build {
972
+ // Explicitly no build script.
973
+ Some ( StringOrBool :: Bool ( false ) ) => None ,
974
+ Some ( StringOrBool :: Bool ( true ) ) => Some ( build_rs) ,
975
+ Some ( StringOrBool :: String ( ref s) ) => Some ( PathBuf :: from ( s) ) ,
976
+ None => {
977
+ // If there is a `build.rs` file next to the `Cargo.toml`, assume it is
978
+ // a build script.
979
+ if build_rs. is_file ( ) {
980
+ Some ( build_rs)
981
+ } else {
982
+ None
983
+ }
984
+ }
985
+ }
986
+ }
You can’t perform that action at this time.
0 commit comments