Skip to content

Commit 40db6ad

Browse files
committed
fixed typo
1 parent f494619 commit 40db6ad

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.icarukTime.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"idleHeartbeats": 14588,
3-
"navigatingHeartbeats": 3016,
4-
"totalCodingHeartbeats": 19114,
3+
"navigatingHeartbeats": 3031,
4+
"totalCodingHeartbeats": 19125,
55
"languageHeartbeats": {
66
"jsonc": 47,
77
"toml": 3591,
8-
"markdown": 10925,
8+
"markdown": 10936,
99
"html": 3210,
1010
"scminput": 1066,
1111
"yaml": 17,
@@ -53,7 +53,7 @@
5353
"content/test/pentagone/index.md": 232,
5454
"git/scm0/input": 234,
5555
"layouts/shortcodes/qr.html": 92,
56-
"content/posts/constructor_in_rust/index.md": 340,
56+
"content/posts/constructor_in_rust/index.md": 351,
5757
"extension-output-mkxml.vscode-filesize-#1-filesize": 210
5858
}
5959
}

content/posts/constructor_in_rust/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ If you have a structure with a lot of fields, it becomes barely usable:
422422
- And it's easy to make a mistake.
423423

424424

425-
And if, in the future, you want to add a new field, you will have to update all constructors. Imagine doing this as a library/crate developer, you can't ask every user to update their code because you decided to add a new field.
425+
And if, in the future, you want to add a new field, you will have to update all the caller. Imagine doing this as a library/crate developer, you can't ask every user to update their code because you decided to add a new field.
426426

427427
Constructors in this case are not the best way to initialize it. It's better to use a builder pattern.
428428

@@ -631,7 +631,7 @@ The inconvenience is that it is hard to know what we can pass to the `new` funct
631631

632632
### Merging the Builder and the Struct
633633

634-
If the struct doesn't have a default value, we can avoid writing a builder and use the same struct for the builder!
634+
If the struct have a default value, we can avoid writing a builder and use the same struct for the builder!
635635

636636
```rs
637637
#[derive(Default)]

0 commit comments

Comments
 (0)