We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61d660e commit b6a54f7Copy full SHA for b6a54f7
1 file changed
Function/FunctionWithGenerics.rs
@@ -0,0 +1,9 @@
1
+fn main() {
2
+ let int_result = identity(42);
3
+ let str_result = identity("Hello");
4
+ println!("IntResult: {}, StrResult: {}", int_result, str_result);
5
+}
6
+
7
+fn identity<T>(value: T) -> T {
8
+ value
9
0 commit comments