Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Borrowing" exercise isn't very good #1513

Open
djmitche opened this issue Nov 29, 2023 · 2 comments
Open

"Borrowing" exercise isn't very good #1513

djmitche opened this issue Nov 29, 2023 · 2 comments
Assignees

Comments

@djmitche
Copy link
Collaborator

The health-statistics exercise isn't really about borrowing. Let's find something better, such as something that re-borrows fields in a struct. Maybe tree traversal?

@djmitche
Copy link
Collaborator Author

From #1565:

  • Would have been helpful to have comments on struct fields
  • u32 to i32 conversions are bad (note that the solution doesn't follow my suggestion to avoid as). Could use u16 to allow .into() conversion to i32, and still cover all conceivable blood pressures.

@fw-immunant
Copy link
Collaborator

To be fair, this exercise used to contain a teachable moment about the way the borrow checker reasons around using the .name() accessor versus borrowing the .name field inline, but at some point that method was removed. I do agree that in its current state this exercise isn't a good fit for curriculum on borrowing, and students have noted this in my classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants