September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,28 @@
trait PrintType {
fn print_type();
}
impl PrintType for char {
fn print_type() {
println!("char");
}
}
impl PrintType for f64 {
fn print_type() {
println!("64-bit float");
}
}
fn prints_type_of_args<T,U>(arg1: T, arg2: U)
where T: PrintType
U: PrintType
{
arg1.print_type();
arg2.print_type();
}
fn main() {
prints_type_of_args('a', 2.0);
prints_type_of_args('a', 'b');
}