@@ -1803,10 +1803,6 @@ pub fn run_cargo(
1803
1803
is_check : bool ,
1804
1804
rlib_only_metadata : bool ,
1805
1805
) -> Vec < PathBuf > {
1806
- if builder. config . dry_run ( ) {
1807
- return Vec :: new ( ) ;
1808
- }
1809
-
1810
1806
// `target_root_dir` looks like $dir/$target/release
1811
1807
let target_root_dir = stamp. parent ( ) . unwrap ( ) ;
1812
1808
// `target_deps_dir` looks like $dir/$target/release/deps
@@ -1913,6 +1909,10 @@ pub fn run_cargo(
1913
1909
crate :: exit!( 1 ) ;
1914
1910
}
1915
1911
1912
+ if builder. config . dry_run ( ) {
1913
+ return Vec :: new ( ) ;
1914
+ }
1915
+
1916
1916
// Ok now we need to actually find all the files listed in `toplevel`. We've
1917
1917
// got a list of prefix/extensions and we basically just need to find the
1918
1918
// most recent file in the `deps` folder corresponding to each one.
@@ -1968,9 +1968,6 @@ pub fn stream_cargo(
1968
1968
cb : & mut dyn FnMut ( CargoMessage < ' _ > ) ,
1969
1969
) -> bool {
1970
1970
let mut cargo = Command :: from ( cargo) ;
1971
- if builder. config . dry_run ( ) {
1972
- return true ;
1973
- }
1974
1971
// Instruct Cargo to give us json messages on stdout, critically leaving
1975
1972
// stderr as piped so we can get those pretty colors.
1976
1973
let mut message_format = if builder. config . json_output {
@@ -1989,6 +1986,11 @@ pub fn stream_cargo(
1989
1986
}
1990
1987
1991
1988
builder. verbose ( & format ! ( "running: {cargo:?}" ) ) ;
1989
+
1990
+ if builder. config . dry_run ( ) {
1991
+ return true ;
1992
+ }
1993
+
1992
1994
let mut child = match cargo. spawn ( ) {
1993
1995
Ok ( child) => child,
1994
1996
Err ( e) => panic ! ( "failed to execute command: {cargo:?}\n error: {e}" ) ,
0 commit comments