Impl spanned functions

This commit is contained in:
2026-05-19 06:11:52 +02:00
parent fd7455c71e
commit 9d051c68e9
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -2,7 +2,7 @@ use <std::fmt::Formatter>;
use <std::fmt>;
pub trait TestLogging<T: fmt::Display>: fmt::Display {
String get();
String get(self*);
}
pub enum LogLevel {
@@ -29,6 +29,12 @@ impl fmt::Display for LogLevel {
}
}
impl TestLogging<LogLevel> for LogLevel {
String get(self*) {
return format!("{self}");
}
}
pub class Logger {
String prefix;
@@ -55,7 +61,7 @@ pub class Logger {
}
LogLevel::Warning => {
println!("{level} {} {}", self.prefix, message);
println!("{} {} {}", level.get(), self.prefix, message);
}
LogLevel::Error => {