Initial commit

This commit is contained in:
2026-04-14 03:44:59 +02:00
commit 0e908afbf7
33 changed files with 595 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
// Procedural macro
// Derive macro
// #[derive(Debug)]
struct User {
first_name: String,
last_name: String,
email: String,
}
impl std::fmt::Display for User {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{} {}", self.first_name, self.last_name)
}
}
fn main() {
let tim = User {
first_name: "Tim".into(),
last_name: "Huizinga".into(),
email: "tim@huizinga.dev".into(),
};
println!("User: {tim}");
// println!("User: {tim:?}");
}