3.1 Structures "because we used that field from `point`" should be "`another_point`"
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 62/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- rust
- Domain
- documentation
Research direction
Search the repository for the quoted comment in the Structures example. Change the reference from point to another_point, then verify that the example's displayed output remains consistent with the corrected explanation.
Written by the indexing model from the issue text.
Description
At least, I'm pretty sure.
Line for reference:
// Instantiate a `Point`
let point: Point = Point { x: 10.3, y: 0.4 };
let another_point: Point = Point { x: 5.2, y: 0.2 };
// Access the fields of the point
println!("point coordinates: ({}, {})", point.x, point.y);
// Make a new point by using struct update syntax to use the fields of our
// other one
let bottom_right = Point { x: 5.2, ..another_point };
// `bottom_right.y` will be the same as `point.y` because we used that field
// from `point`
println!("second point: ({}, {})", bottom_right.x, bottom_right.y);
Which prints
point coordinates: (10.3, 0.4)
second point: (5.2, 0.2)
As you can see, it is the same as another_point.y, and not point.y :)
- Dominant language
- Handlebars
- Stars
- 8.1k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/rust-by-example
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
rust-lang/rust-by-example#2031 ·
-
discussion
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
rust-lang/rust-by-example#1820 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
rust-lang/rust-by-example#1581 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rust-lang/rust-by-example#1256 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
rust-lang/rust-by-example#2023 ·
All issues in rust-lang/rust-by-example
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Opencategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficulty 1/5 Under an hour Newbie friendliness 84/100