提交 b17c4720 编写于 作者: jackymao.com's avatar jackymao.com

fix typo

上级 e42db618
...@@ -35,18 +35,18 @@ let y = |x| a * x + b; ...@@ -35,18 +35,18 @@ let y = |x| a * x + b;
Rust 编译器会将它改写成(这里只是演示,为了简洁有所省略): Rust 编译器会将它改写成(这里只是演示,为了简洁有所省略):
```rust ```rust
struct SomeUnknowType { struct SomeUnknownType {
a: f64, a: f64,
b: f64, b: f64,
} }
impl SomeUnknowType { impl SomeUnknownType {
fn call(&self, x: f64) -> f64 { fn call(&self, x: f64) -> f64 {
self.a * x + self.b self.a * x + self.b
} }
} }
let y = SomeUnknowType { a: 2.0, b: 3.0 }; let y = SomeUnknownType { a: 2.0, b: 3.0 };
y.call(x) y.call(x)
``` ```
...@@ -162,7 +162,7 @@ fn main() { ...@@ -162,7 +162,7 @@ fn main() {
``` ```
### 使用 Tuple stype Struct ### 使用 Tuple Struct
```rust ```rust
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册