Skip to content

Commit 005709c

Browse files
author
neo
committed
开始
0 parents  commit 005709c

14 files changed

+95
-0
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
/code/**/target/*

Diff for: .idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/rust-notebook.iml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
![Banner](./banner.png)
2+
#### 参考资料
3+
> [Rust 语言圣经](https://course.rs/about-book.html)

Diff for: banner.png

107 KB
Loading

Diff for: code/code-001/Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: code/code-001/Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "code-001"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]

Diff for: code/code-001/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
`code-001`
2+
3+
## 你好世界
4+
5+
---
6+
7+
最基本的项目,任何编程语言都从这里开始☝️🤓

Diff for: code/code-001/src/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

Diff for: note/001-安装.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 安装 Rust
2+
3+
安装部分直接根据官网部分:
4+
[安装 Rust](https://www.rust-lang.org/zh-CN/learn/get-started)
5+
6+
或者可以参考 [Rust - 圣经安装 Rust](https://course.rs/first-try/installation.html)
7+
8+
> 📌 下次重装电脑可以重新记录一下再 macos 和 windows 、linux全新安装的过程
9+

Diff for: note/002-创建项目.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# 创建项目
2+
3+
> 在 Rust 中,项目主要分为两个类型, bin 和 lib 类型
4+
>
5+
> `bin` 类型为一个可以运行的项目,就像前端里 vite 创建的 vue 项目
6+
>
7+
> `lib` 类型就是创建一个依赖库,提供给应用使用
8+
9+
### 创建一个项目 (bin 类型)
10+
11+
使用 `cargo new [包名]` 来创建一个新的 rust 项目,这个命令会创建一个新的目录,里面有一个最基本的 Rust 项目结构
12+
13+
如果需要在一个目录初始化项目,可以使用 `cargo init` 在当前的目录初始化项目
14+
15+
输出内容:
16+
```
17+
Creating binary (application) package
18+
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
19+
```
20+

Diff for: note/003-运行项目.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 运行项目
2+
3+
### 立即运行代码

0 commit comments

Comments
 (0)