This commit is contained in:
林觅
2026-10-09 22:16:17 +08:00
parent 06d7b6594a
commit 4ebe3f263e
3 changed files with 51 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/
# Executables
*.swf
*.air
*.ipa
*.apk
*.log
*.exe
*.lock
logs/
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
# 忽略名为__pycache__的目录及其所有内target/
*/node_modules/
*/target/
+12
View File
@@ -0,0 +1,12 @@
# https://colobu.com/rust100/
## 创建Rust项目
```bash
cargo new my_rust_project
cd my_rust_project
```
## 运行与调试项目
```bash
cargo run
```
+17
View File
@@ -0,0 +1,17 @@
# 参考文档 https://colobu.com/rust100/
## 注释
```rust
// rust中的注释也是 //
```
## 函数
```rust
// `fn` <function_name> ( <input parameters> ) -> <return_type> { <body> }
fn greeting() -> &'static str {
// TODO: fix me 👇
"I'm ready to __!"
}
```
- greeting没有输入参数,返回一个字符串切片引用(&'static str)。