chore: 初始化 Rust 第五部分学习项目
添加了 part5 项目的 Cargo 配置、示例代码和 Rust 枚举练习题文档
This commit is contained in:
parent
5cad182723
commit
7efa839f7a
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
alwaysApply: true
|
||||||
|
scene: git_message
|
||||||
|
language: zh-CN
|
||||||
|
---
|
||||||
|
|
||||||
|
在此处编写规则,自定义 AI 生成提交信息的风格。
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "part5"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "part5"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,19 @@
|
||||||
|
#[derive(Debug)]
|
||||||
|
enum Direction {
|
||||||
|
North,
|
||||||
|
South,
|
||||||
|
East,
|
||||||
|
West,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum IpAddr {
|
||||||
|
V4(String),
|
||||||
|
V6(String),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let direction = Direction::North;
|
||||||
|
println!(" direction: {:?}", direction);
|
||||||
|
let home = IpAddr::V4(String::from("127.0.0.1"));
|
||||||
|
// println!(" home: {:?}", home);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue