Monomorphization turns a generic function into a separate concrete function for every type used with it. Rust performs this during compilation, so the resulting program can run faster. section 18.1.2
One generic function, two concrete forms
A generic `print_and_return<T>` called with a string and an `f64` can become forms such as `print_and_return_str(&str)` and `print_and_return_f64(f64)`. The compiler handles this automatically; you only notice that generic code may take slightly longer to compile. section 18.1.2
use std::fmt::Display;
fn print_and_return<T: Display>(input: T) -> T {
println!("You gave me {input} and now I will give it back.");
input
}
fn main() {
let my_name = print_and_return("Windy");
let small_number = print_and_return(9.0);
}
Inspect the generic function and its two calls that motivate the specialized forms. section 18.1.2

