1
1
mod traits {
2
2
use crate :: path_to_enlightenment:: visibility:: ticket:: Status ;
3
3
4
- /// You might have noticed that in the test for the previous koan
5
- /// we haven't checked if the status returned by `.status()` matched
6
- /// the status we passed to `create_ticket`.
4
+ /// You might have noticed that in the test for the previous koan we haven't checked if
5
+ /// the status returned by `.status()` matched the status we passed to `create_ticket`.
7
6
///
8
- /// That's because `assert_eq!(ticket.status(), Status::ToDo)` would have
9
- /// thrown a compiler error:
7
+ /// That's because `assert_eq!(ticket.status(), Status::ToDo)` would have failed to compiled:
10
8
///
11
9
/// error[E0369]: binary operation `==` cannot be applied to type `&path_to_enlightenment::visibility::ticket::Status`
12
10
/// --> jira-wip/src/koans/01_ticket/05_ownership.rs:128:13
@@ -20,7 +18,7 @@ mod traits {
20
18
/// = note: an implementation of `std::cmp::PartialEq` might be missing for `&path_to_enlightenment::visibility::ticket::Status`
21
19
///
22
20
/// `assert_eq` requires that its arguments implement the `PartialEq` trait.
23
- /// What is trait?
21
+ /// What is a trait?
24
22
/// Traits in Rust are very similar to interfaces in other programming languages:
25
23
/// a trait describes a behaviour/capability.
26
24
/// For example:
@@ -33,7 +31,7 @@ mod traits {
33
31
///
34
32
/// In practical terms, a trait defines the signature of a collection of methods.
35
33
/// To implement a trait, a struct or an enum have to implement those methods
36
- /// in `impl Trait` block:
34
+ /// in an `impl Trait` block:
37
35
///
38
36
/// ```
39
37
/// impl Pay for TaxPayer {
0 commit comments