use std::fmt;
fn main() {
let tado = Rustacean{name: "Tadeas", pronouns: &Pronouns::HeHim, distro: "NixOS"};
println!("{tado}");
}
#[allow(dead_code)]
struct Rustacean<'a> {
name: &'a str,
pronouns: &'a Pronouns<'a>,
distro: &'a str,
}
#[allow(dead_code)]
enum Pronouns<'a> {
HeHim,
SheHer,
TheyThem,
ItIts,
Other(&'a str),
}
impl fmt::Display for Rustacean<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Hi! I am {}, and use {} BTW!", self.name, self.distro)
}
}
Pinned Loading
-
-
ratatui/ratatui
ratatui/ratatui PublicA Rust crate for cooking up terminal user interfaces (TUIs) 👨🍳🐀 https://ratatui.rs
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.