Skip to content

Update main.rs to show the full example #4325

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hunter-Plus
Copy link

It's better if readers can also see "let (tx, mut rx) = trpl::channel();" in this example to align with others in this chapter. By doing this, beginners will have less unnecessary confusions when trying to run the demo.

It's better if readers can also see "let (tx, mut rx) = trpl::channel();" in this example to align with others in this chapter. By doing this, beginners will have less unnecessary confusions when trying to run the demo.
Copy link
Contributor

@rickrain rickrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall this when I read it the first time and think it would be helpful. After all, it is just 1 line of code and therefore not saving much screen real estate.

Readers do have the option (at any time) to review the full source listing though.
image

Not sure what the right balance is but I specifically remembered this when I went through it the first time.

@Hunter-Plus
Copy link
Author

Hunter-Plus commented Apr 25, 2025

I recall this when I read it the first time and think it would be helpful. After all, it is just 1 line of code and therefore not saving much screen real estate.

Readers do have the option (at any time) to review the full source listing though. image

Not sure what the right balance is but I specifically remembered this when I went through it the first time.

Thank you for your attention on this! I think the point is to make the hidden lines to align with other examples in this chapter to avoid any confusion for beginners. Also, we can hide this line of other examples to save more screen except for the first one. Please feel free to consider my change or close this PR and use other alternatives~

Rust book is definitely the best tutorial I've ever read, appreciate your efforts on it! Have a wonderful weekend ahead!

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.

2 participants