From 2fc747010b8746b876da245024cf6cd5b83fb59a Mon Sep 17 00:00:00 2001 From: Bradley Odell Date: Mon, 12 Feb 2024 19:07:55 -0800 Subject: [PATCH 1/2] Add `is_set` public function. --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c2d1fca..2bf866a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -99,6 +99,12 @@ impl Verbosity { } } + /// Whether any verbosity flags (either `--verbose` or `--quiet`) + /// have been specified on the command line. + pub fn is_set(&self) -> bool { + self.verbose != 0 || self.quiet != 0 + } + /// Get the log level. /// /// `None` means all output is disabled. From ef150436118d5dfeae7a3be384b218994a8b9fa4 Mon Sep 17 00:00:00 2001 From: Bradley Odell Date: Wed, 14 Feb 2024 10:15:31 -0800 Subject: [PATCH 2/2] Update function name and docs. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2bf866a..13fbfb3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,8 +100,8 @@ impl Verbosity { } /// Whether any verbosity flags (either `--verbose` or `--quiet`) - /// have been specified on the command line. - pub fn is_set(&self) -> bool { + /// are present on the command line. + pub fn is_present(&self) -> bool { self.verbose != 0 || self.quiet != 0 }