mirror of https://github.com/sunface/rust-course
parent
abf76ebdae
commit
bcf5c27c05
@ -1,11 +1,10 @@
|
|||||||
[book]
|
[book]
|
||||||
authors = ["sunface"]
|
authors = ["sunface"]
|
||||||
language = "en"
|
language = "zh-CN"
|
||||||
multilingual = false
|
title = "Rust编程指南(The Way To Rust)"
|
||||||
src = "src"
|
|
||||||
title = "The way to rust"
|
|
||||||
|
|
||||||
[output.html]
|
[output.html]
|
||||||
additional-css = ["assets/ferris.css", "assets/theme/2018-edition.css"]
|
additional-css = ["assets/ferris.css", "assets/theme/2018-edition.css"]
|
||||||
additional-js = ["assets/ferris.js"]
|
additional-js = ["assets/ferris.js"]
|
||||||
git-repository-url = "https://github.com/rustcm/the-way-to-rust"
|
git-repository-url = "https://github.com/rustcm/the-way-to-rust"
|
||||||
|
edit-url-template = "https://github.com/rustcm/the-way-to-rust/edit/main/{path}"
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
[[package]]
|
||||||
|
name = "variables"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
[package]
|
||||||
|
name = "variables"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Your Name <you@example.com>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
@ -0,0 +1,20 @@
|
|||||||
|
$ cargo run
|
||||||
|
Compiling variables v0.1.0 (file:///projects/variables)
|
||||||
|
error[E0384]: cannot assign twice to immutable variable `x`
|
||||||
|
--> src/main.rs:4:5
|
||||||
|
|
|
||||||
|
2 | let x = 5;
|
||||||
|
| -
|
||||||
|
| |
|
||||||
|
| first assignment to `x`
|
||||||
|
| help: make this binding mutable: `mut x`
|
||||||
|
3 | println!("The value of x is: {}", x);
|
||||||
|
4 | x = 6;
|
||||||
|
| ^^^^^ cannot assign twice to immutable variable
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0384`.
|
||||||
|
error: could not compile `variables`
|
||||||
|
|
||||||
|
To learn more, run the command again with --verbose.
|
@ -0,0 +1,6 @@
|
|||||||
|
fn main() {
|
||||||
|
let x = 5;
|
||||||
|
println!("The value of x is: {}", x);
|
||||||
|
x = 6;
|
||||||
|
println!("The value of x is: {}", x);
|
||||||
|
}
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
# A-关键字
|
|
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 6.1 KiB |
@ -1 +1,4 @@
|
|||||||
## 认识Cargo
|
## 认识Cargo
|
||||||
|
|
||||||
|
|
||||||
|
## cargo check
|
Loading…
Reference in new issue