12 lines
240 B
Rust
12 lines
240 B
Rust
|
//
|
||
|
pub trait Printer {
|
||
|
fn println(&self, message: impl Into<String>);
|
||
|
}
|
||
|
|
||
|
pub struct StandardPrinter;
|
||
|
impl Printer for StandardPrinter {
|
||
|
fn println(&self, message: impl Into<String>) {
|
||
|
println!("{}", message.into());
|
||
|
}
|
||
|
}
|