123456
This commit is contained in:
@@ -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