use std::fmt;
fn main() {
println!("# Hello, World! 🌍");
let i_am = Person {
name: "Ruud",
profession: "software engineer",
from: "Nijmegen, the Netherlands",
home_page: "https://www.ruud.online",
};
println!();
println!("{}", i_am);
}
struct Person<'a> {
name: &'a str,
profession: &'a str,
from: &'a str,
home_page: &'a str,
}
impl fmt::Display for Person<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"My name is {} and I am a {} from {}. To learn more, please visit [my homepage]({}).",
self.name, self.profession, self.from, self.home_page,
)
}
}
Pinned Loading
-
-
Computes all primes up to a certain ...
Computes all primes up to a certain number. 1use std::env;
23fn main() {
4let n = env::args()
5.nth(1)
-
-
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.