123456
This commit is contained in:
+22
@@ -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/
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# https://colobu.com/rust100/
|
||||||
|
|
||||||
|
|
||||||
|
## 创建Rust项目
|
||||||
|
```bash
|
||||||
|
cargo new my_rust_project
|
||||||
|
cd my_rust_project
|
||||||
|
```
|
||||||
|
## 运行与调试项目
|
||||||
|
```bash
|
||||||
|
cargo run
|
||||||
|
```
|
||||||
@@ -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)。
|
||||||
Reference in New Issue
Block a user