From 9dea46b5e66eb54746b251d8950b2367c49be23d Mon Sep 17 00:00:00 2001 From: hybrid Date: Wed, 11 Nov 2026 17:16:48 +0300 Subject: add: supertraits, ext_traits, pancakes, hello, hello_macro --- src/ext_traits/Cargo.toml | 6 ++++++ src/ext_traits/src/main.rs | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/ext_traits/Cargo.toml create mode 100644 src/ext_traits/src/main.rs (limited to 'src/ext_traits') diff --git a/src/ext_traits/Cargo.toml b/src/ext_traits/Cargo.toml new file mode 100644 index 0000000..49354b6 --- /dev/null +++ b/src/ext_traits/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ext_traits" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/src/ext_traits/src/main.rs b/src/ext_traits/src/main.rs new file mode 100644 index 0000000..f5d8886 --- /dev/null +++ b/src/ext_traits/src/main.rs @@ -0,0 +1,14 @@ +use std::fmt; + +struct Wrapper(Vec); + +impl fmt::Display for Wrapper { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "[{}]", self.0.join(", ")) + } +} + +fn main() { + let w = Wrapper(vec![String::from("hello"), String::from("world")]); + println!("w = {w}"); +} -- cgit v1.3.1