You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: subjects/check_user_name/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,12 @@ You will also have to create a `User` struct which has:
12
12
13
13
- Fields:
14
14
-`name`: `String`
15
-
-`acessLevel`: `enum`
15
+
-`access_level`: `AccessLevel`
16
16
- Associated functions:
17
17
-`new`: which initializes the struct.
18
18
-`send_name`: which takes only `self` as argument and returns an `Option<&str>` with `None` if the user is a `Guest` or the `name` if the `AccessLevel` has any of the other options.
19
19
- Other functions:
20
-
-`check_user_name`: which takes a `User`, calls `send_name` and returns a `tuple` with `true` and the user `name` if `send_name` returns the name or `false` and `"Error: User is guest"` if not.
20
+
-`check_user_name`: which takes a reference to `User`, calls `send_name` and returns a `tuple` with `true` and the user `name` if `send_name` returns the name or `false` and `"ERROR: User is guest"` if not.
0 commit comments