Ref: Vereinfacht try_from-Signatur in LogLevel-Implementierung.
This commit is contained in:
@@ -26,9 +26,9 @@ use std::fs::{create_dir_all, File, OpenOptions};
|
||||
use std::io::{stdout, IsTerminal, Write};
|
||||
use std::sync::{Mutex, OnceLock};
|
||||
|
||||
use time::{macros::format_description, OffsetDateTime};
|
||||
use crate::program;
|
||||
use crate::config;
|
||||
use crate::program;
|
||||
use time::{macros::format_description, OffsetDateTime};
|
||||
|
||||
/// Schweregrade für Logeinträge in aufsteigender Detailtiefe.
|
||||
///
|
||||
@@ -65,7 +65,7 @@ impl Display for LogLevel {
|
||||
impl TryFrom<String> for LogLevel {
|
||||
type Error = LogLevel;
|
||||
|
||||
fn try_from(value: std::string::String) -> Result<Self, Self> {
|
||||
fn try_from(value: String) -> Result<Self, Self> {
|
||||
match value.to_lowercase().as_str() {
|
||||
"error" => Ok(LogLevel::Error),
|
||||
"warn" => Ok(LogLevel::Warn),
|
||||
|
||||
Reference in New Issue
Block a user