mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2026-08-22 14:13:28 +08:00
Refining Ch06.
This commit is contained in:
8
projects/option_demo/Cargo.toml
Normal file
8
projects/option_demo/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "option_demo"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
6
projects/option_demo/src/main.rs
Normal file
6
projects/option_demo/src/main.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
fn main() {
|
||||
let x: i8 = 5;
|
||||
let y: Option<i8> = Some(5);
|
||||
|
||||
let sum = x + y;
|
||||
}
|
||||
Reference in New Issue
Block a user