motd-rust/src/structs.rs
2024-08-06 13:44:04 +10:00

16 lines
295 B
Rust

pub struct MOTD {
title: Option<String>,
}
impl MOTD {
pub fn new(motd_title: String) -> MOTD {
return MOTD {
title: Some(String::from(motd_title)),
};
}
pub fn print(&self) {
println!("[*] {}", &self.title.as_ref().unwrap().trim())
}
}