diff options
| author | onur-ozkan <work@onurozkan.dev> | 2024-09-30 14:20:12 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2024-09-30 14:20:12 +0300 |
| commit | fd1429a56b5c6eadb6205c982f4945b631f55db9 (patch) | |
| tree | 00de87c805aefe23dc308eec918b9fc4b5fe00b6 /src | |
| parent | 612796c42077605fdd3c6f7dda05745d8f4dc4d8 (diff) | |
| download | rust-fd1429a56b5c6eadb6205c982f4945b631f55db9.tar.gz rust-fd1429a56b5c6eadb6205c982f4945b631f55db9.zip | |
replace manual verbose checks with `Config::is_verbose`
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/builder.rs | 4 | ||||
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index 47420f8fe72..5653b29fda8 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -1562,8 +1562,8 @@ impl<'a> Builder<'a> { let libdir = self.rustc_libdir(compiler); let sysroot_str = sysroot.as_os_str().to_str().expect("sysroot should be UTF-8"); - if !matches!(self.config.dry_run, DryRun::SelfCheck) { - self.verbose_than(0, || println!("using sysroot {sysroot_str}")); + if self.is_verbose() && !matches!(self.config.dry_run, DryRun::SelfCheck) { + println!("using sysroot {sysroot_str}"); } let mut rustflags = Rustflags::new(target); diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 77e0ece3104..0689a4caa9a 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -2428,7 +2428,7 @@ impl Config { /// Runs a function if verbosity is greater than 0 pub fn verbose(&self, f: impl Fn()) { - if self.verbose > 0 { + if self.is_verbose() { f() } } @@ -2713,7 +2713,7 @@ impl Config { .success(); if has_changes { if if_unchanged { - if self.verbose > 0 { + if self.is_verbose() { println!( "WARNING: saw changes to compiler/ or library/ since {commit}; \ ignoring `download-rustc`" @@ -2810,7 +2810,7 @@ impl Config { let has_changes = !t!(git.as_command_mut().status()).success(); if has_changes { if if_unchanged { - if self.verbose > 0 { + if self.is_verbose() { println!( "warning: saw changes to one of {modified_paths:?} since {commit}; \ ignoring `{option_name}`" |
