https://github.com/zikwall/hello-rust
First aka Hello Rust experience
https://github.com/zikwall/hello-rust
Last synced: 9 months ago
JSON representation
First aka Hello Rust experience
- Host: GitHub
- URL: https://github.com/zikwall/hello-rust
- Owner: zikwall
- Created: 2020-02-26T11:11:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-11T12:54:31.000Z (over 6 years ago)
- Last Synced: 2025-02-23T20:44:00.245Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Hello Rust
Begin!
First aka Hello Rust experience
### Rust not installed?
1. `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
2. `export PATH=$HOME/.cargo/bin:$PATH` or add `bashrc`, `*_profile`
3. `source ~/.bashrc`
#### Not help? This still is broken in Linux.
- [x] when you edit the .profile you should be putting.
```shell script
if [ -d "$HOME/.cargo/bin" ] ; then
PATH="$HOME/.cargo/bin:$PATH"
fi
```
- [x] You should run the following as the very last thing the main() function does.
```shell script
$(source ~/.profile)
# or
# exec source $HOME/.profile
exit
```
3. `rustc --version` => `rustc 1.41.0 (5e1a79984 2020-01-27)`
### Run Hello
1. `rustc hello.rs --out-dir builds/`
2. `cd builds/ && ./hello`
3. Happy ^_^
4. But this is not serious, soon it will be so...
### Run Hello Actix
1. `cargo run`
2. visit `localhost:8088` and `localhost:8088/again`
3. `cargo build --target-dir ../builds/ --release`
4. `cd builds/release && ./hello_actix`
### Guess Game
1. `cd guessing_game/ && cargo run`
2. Good luck
### How IDE use?
You can use the IntellIJ family IDEs such as PyCharm, GoLand, PHPStorm & etc.
Just install the appropriate plugin for Rust, and you can also install a special color plugin:
IntelliJ Rust: `https://intellij-rust.github.io/docs/quick-start.html`