Skip to content

Commit

Permalink
Merge pull request #199 from StephLin/feature/fix-ch19-typo
Browse files Browse the repository at this point in the history
fix: Fix typo in ch19-02
  • Loading branch information
wusyong authored Feb 12, 2024
2 parents 456d458 + 08216a6 commit 165a8cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch19-02-advanced-traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Rust 不允許建立你自己的運算子或重載任意的運算子,但你可

<span class="caption">範例 19-14:藉由實作 `Add` 特徵,重載 `Point` 實例的 `+` 運算子</span>

`add` 方法將兩個 `Point` 實例的 `x` 值相加,兩個 `y` 值相加,並建立新的 `Point` 實例。`Add` 特徵有個關聯型別 `Outpout` 可以決定 `add` 方法回傳的型別。
`add` 方法將兩個 `Point` 實例的 `x` 值相加,兩個 `y` 值相加,並建立新的 `Point` 實例。`Add` 特徵有個關聯型別 `Output` 可以決定 `add` 方法回傳的型別。

這段程式碼的預設泛型型別寫在 `Add` 特徵中,定義如下:

Expand Down

0 comments on commit 165a8cd

Please sign in to comment.