File tree 1 file changed +3
-3
lines changed
content/lessons/05_types_reasoning
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -339,15 +339,15 @@ The problem here is that nothing hinders us from implement the trait (with vario
339
339
340
340
The use of generic types in ` Summary ` trait makes it semantics like this:
341
341
342
- > Any type can be summarized with any type supporting it.
342
+ > A type can be summarized with any type supporting it.
343
343
344
- When we want the trait to require exactly one possible generic implementation for a given type, we can leverage _ associated types _ . Example here:
344
+ When we want the trait to require exactly one possible generic implementation for a given type, we can leverage * associated types * . Example here:
345
345
346
346
{{ include_code_sample(path="lessons/05_types_reasoning/trait_associated_type.rs", language="rust") }}
347
347
348
348
The use of associated types in Summary trait makes it semantics like this:
349
349
350
- > Any type can be summarized with at most one specific type.
350
+ > A type can be summarized with at most one specific type.
351
351
352
352
Yet another approach (arguably, the cleanest one) would be to use the ` impl trait ` syntax in a trait (quite recently stabilized!).
353
353
Example:
You can’t perform that action at this time.
0 commit comments