17 lines
355 B
Markdown
17 lines
355 B
Markdown
# 参考文档 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)。 |