mirror of https://github.com/sunface/rust-course
Merge pull request #267 from mg-chao/20220120_translate_option
[rust-exercise] 翻译 option 部分pull/271/head
commit
060226f7c2
@ -1,11 +1,10 @@
|
|||||||
# Generics
|
# 泛型
|
||||||
|
|
||||||
Generics is the topic of generalizing types and functionalities to broader cases.
|
泛型的主旨是把类型和函数泛化到多种情况。
|
||||||
This is extremely useful for reducing code duplication in many ways, but can call for rather involving syntax.
|
这在很多方面有助于减少重复代码,但也可能需要为此使用相当多的语法。
|
||||||
Namely, being generic requires taking great care to specify over which types a generic type is actually considered valid.
|
也就是说,使用泛型的话则需要小心谨慎地标明泛型适用于哪些类型。
|
||||||
The simplest and most common use of generics is for type parameters.
|
|
||||||
|
|
||||||
## Further information
|
## 更多信息
|
||||||
|
|
||||||
- [Generic Data Types](https://doc.rust-lang.org/stable/book/ch10-01-syntax.html)
|
- [Generic Data Types](https://doc.rust-lang.org/stable/book/ch10-01-syntax.html)
|
||||||
- [Bounds](https://doc.rust-lang.org/rust-by-example/generics/bounds.html)
|
- [Bounds](https://doc.rust-lang.org/rust-by-example/generics/bounds.html)
|
||||||
|
Loading…
Reference in new issue