Skip to content

Clarify implicit unit return in functions chapter#4702

Open
XiaoPengMei wants to merge 1 commit intorust-lang:mainfrom
XiaoPengMei:docs/clarify-unit-type-return-4678
Open

Clarify implicit unit return in functions chapter#4702
XiaoPengMei wants to merge 1 commit intorust-lang:mainfrom
XiaoPengMei:docs/clarify-unit-type-return-4678

Conversation

@XiaoPengMei
Copy link
Copy Markdown

Closes #4678

Summary

  • replace the phrase "nothing is returned" with wording that matches the compiler output
  • explain that adding the semicolon makes plus_one implicitly return (), the unit type

Validation

  • mdbook build

Notes

  • AI-assisted: I used Sisyphus to help draft and validate this wording change, and I reviewed the final diff before submission.

Align the prose with the compiler output by explaining that the semicolon makes the function implicitly return the unit type instead of suggesting that nothing is returned.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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

Successfully merging this pull request may close these issues.

"nothing is returned" contradicts compiler output in Functions chapter

1 participant