Skip to content

Commit 06d4d15

Browse files
committed
refactor: use slice in place of String
Signed-off-by: Ivin Joel Abraham <[email protected]>
1 parent 949ec3a commit 06d4d15

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/commands/set_log_level.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,9 @@ use tracing::info;
2222
use tracing::instrument;
2323
use tracing_subscriber::EnvFilter;
2424
/// Returns whether the provided `level` String is a valid filter level for tracing.
25-
fn validate_level(level: &String) -> bool {
25+
fn validate_level(level: &str) -> bool {
2626
const VALID_LEVELS: [&str; 5] = ["trace", "debug", "info", "warn", "error"];
27-
if !VALID_LEVELS.contains(&level.as_str()) {
28-
true
29-
} else {
30-
false
31-
}
27+
!VALID_LEVELS.contains(&level)
3228
}
3329

3430
fn build_filter_string(level: String, enable_debug_libraries: bool) -> anyhow::Result<String> {

0 commit comments

Comments
 (0)