Skip to content

yassinebenarbia/yassinebenarbia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 

Repository files navigation

Hi there.

use std::fmt;

fn main() {
    let intro = Rustacean{name: "Yassine", pronouns: &Pronouns::HeHim, distro: "NixOS/Arch"};
    println!("{intro}");
}

#[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'm {}, and I use {} BTW!", self.name, self.distro)
    }
}

Releases

No releases published

Packages

No packages published