replace manual verbose checks with Config::is_verbose
Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
parent
612796c420
commit
fd1429a56b
2 changed files with 5 additions and 5 deletions
|
@ -1562,8 +1562,8 @@ impl<'a> Builder<'a> {
|
||||||
let libdir = self.rustc_libdir(compiler);
|
let libdir = self.rustc_libdir(compiler);
|
||||||
|
|
||||||
let sysroot_str = sysroot.as_os_str().to_str().expect("sysroot should be UTF-8");
|
let sysroot_str = sysroot.as_os_str().to_str().expect("sysroot should be UTF-8");
|
||||||
if !matches!(self.config.dry_run, DryRun::SelfCheck) {
|
if self.is_verbose() && !matches!(self.config.dry_run, DryRun::SelfCheck) {
|
||||||
self.verbose_than(0, || println!("using sysroot {sysroot_str}"));
|
println!("using sysroot {sysroot_str}");
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut rustflags = Rustflags::new(target);
|
let mut rustflags = Rustflags::new(target);
|
||||||
|
|
|
@ -2428,7 +2428,7 @@ impl Config {
|
||||||
|
|
||||||
/// Runs a function if verbosity is greater than 0
|
/// Runs a function if verbosity is greater than 0
|
||||||
pub fn verbose(&self, f: impl Fn()) {
|
pub fn verbose(&self, f: impl Fn()) {
|
||||||
if self.verbose > 0 {
|
if self.is_verbose() {
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2713,7 +2713,7 @@ impl Config {
|
||||||
.success();
|
.success();
|
||||||
if has_changes {
|
if has_changes {
|
||||||
if if_unchanged {
|
if if_unchanged {
|
||||||
if self.verbose > 0 {
|
if self.is_verbose() {
|
||||||
println!(
|
println!(
|
||||||
"WARNING: saw changes to compiler/ or library/ since {commit}; \
|
"WARNING: saw changes to compiler/ or library/ since {commit}; \
|
||||||
ignoring `download-rustc`"
|
ignoring `download-rustc`"
|
||||||
|
@ -2810,7 +2810,7 @@ impl Config {
|
||||||
let has_changes = !t!(git.as_command_mut().status()).success();
|
let has_changes = !t!(git.as_command_mut().status()).success();
|
||||||
if has_changes {
|
if has_changes {
|
||||||
if if_unchanged {
|
if if_unchanged {
|
||||||
if self.verbose > 0 {
|
if self.is_verbose() {
|
||||||
println!(
|
println!(
|
||||||
"warning: saw changes to one of {modified_paths:?} since {commit}; \
|
"warning: saw changes to one of {modified_paths:?} since {commit}; \
|
||||||
ignoring `{option_name}`"
|
ignoring `{option_name}`"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue