Sign in


macro_rules! map {
($($key:expr => $value:expr),*) => (
$( println!(“{:?} {:?}”, $key, $value); )*
)
}
fn main() {
map!(
“name” => “finn”,
“gender” => “aoeu”
);
}

use std::fmt;struct Point<T, U> {
x: T,
y: U,
}
# impl<T: fmt::Display, U: fmt::Display> fmt::Display for Point<T, U>
impl<T, U> fmt::Display for Point<T, U>
where
T: fmt::Display,
U: fmt::Display,
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, “({}, {})”, self.x, self.y)
}
}

Water_J

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store