Skip to content

Commit f74f058

Browse files
Use Field Init Shorthand in the logon struct.
If a struct field, and variable used to initialize it, have the same name, there's no need to write them both.
1 parent 62b3ff2 commit f74f058

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/std/hash/alt_key_types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ fn try_logon<'a>(accounts: &Accounts<'a>,
5050
println!("Attempting logon...");
5151
5252
let logon = Account {
53-
username: username,
54-
password: password,
53+
username,
54+
password,
5555
};
5656
5757
match accounts.get(&logon) {

0 commit comments

Comments
 (0)