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

Add cargo commands to the tutorial #565

Merged
merged 4 commits into from
Apr 23, 2021

Conversation

Keksoj
Copy link
Contributor

@Keksoj Keksoj commented Apr 21, 2021

As discussed in #503 , the tutorial becomes confusing around the Channel section. I have idenitfied it as a lack of instructions on structuring the code.

Following the pattern of instructions of the Spawning page (create an examples/ directory, rename main.rs into it), I have edited the tutorial so it suggests to rename / create binary files in a bin directory:

  • src/bin/server.rs
  • src/bin/client.rs
  • src/bin/echo-server-copy.rs
  • src/bin/echo-server.rs

With all the additional run instructions: cargo run --bin … and some verbosity.

I believe this will help learners like me who like to type code and tend to be reassured when told where and how.

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines 172 to 174
(We won't really try out the server, but feel free to build your own little client using
[tokio::net::TcpStream example](https://docs.rs/tokio/1.4.0/tokio/net/struct.TcpStream.html#examples)
with the proper socket address.)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(We won't really try out the server, but feel free to build your own little client using
[tokio::net::TcpStream example](https://docs.rs/tokio/1.4.0/tokio/net/struct.TcpStream.html#examples)
with the proper socket address.)
You will be able to try the server using a standard command-line tool such as `telnet`, or by writing
a simple client like the one found in the documentation for [`tokio::net::TcpStream`][tcp_example].
[tcp_example]: https://docs.rs/tokio/1/tokio/net/struct.TcpStream.html#examples

Comment on lines 9 to 10
mkdir src/bin
mv src/main.rs src/bin/server.rs
Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to change this to a fenced code block for our CI setup to not consider this as Rust code that it can run.

```text
mkdir src/bin
mv src/main.rs src/bin/server.rs
```

@Keksoj
Copy link
Contributor Author

Keksoj commented Apr 21, 2021

I put backticks but the CI still fails. Can't find the bug :/ oh. Three backticks + text. Got it. On it.

@Keksoj
Copy link
Contributor Author

Keksoj commented Apr 21, 2021

Looks ready to me.

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks.

@Darksonn Darksonn merged commit 008190f into tokio-rs:master Apr 23, 2021
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