19 lines
233 B
Rust
19 lines
233 B
Rust
|
|
fn identity<T>(v: T) -> T {
|
|
return v;
|
|
}
|
|
|
|
fn main()
|
|
{
|
|
let a = identity::<i32>(123);
|
|
// expect: 123
|
|
print(a);
|
|
|
|
let b = identity("abc");
|
|
// expect: abc
|
|
print(b);
|
|
}
|
|
|
|
// vim: syntax=rust commentstring=//\ %s
|
|
|