This commit is contained in:
Edgar 2024-07-01 15:12:17 +02:00
parent 29de1ab1fd
commit cb6149c539
No known key found for this signature in database
GPG key ID: 70ADAE8F35904387

View file

@ -6,7 +6,7 @@ description = "A simple trick to avoid generics generating a lot of code."
categories = ["rust"]
+++
When using generics in Rust (an any language that supports this), what happens under the hood is that the compiler generates a function
When using generics in Rust (and any language that supports this), what happens under the hood is that the compiler generates a function
implementation when it finds a call for each combination of different types used in the generic parameters.
This can produce a lot of code if the function body is big.