Skip to content

Commit

Permalink
Update ch10-00-generics.md
Browse files Browse the repository at this point in the history
  • Loading branch information
green961 authored Feb 10, 2024
1 parent 78c8463 commit cdfcd55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch10-00-generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

为了消除重复,我们要创建一层抽象,定义一个处理任意整型列表作为参数的函数。这个方案使得代码更简洁,并且表现了寻找任意列表中最大值这一概念。

在示例 10-3 的程序中将寻找最大值的代码提取到了一个叫做 `largest` 的函数中。接着我们调用了示例 10-2 中寻找两个列表中最大值的函数。之后也可以将该函数用于任何可能的 `i32` 值的列表。
在示例 10-3 的程序中将寻找最大值的代码提取到了一个叫做 `largest` 的函数中。接着我们调用该函数来寻找示例 10-2 中两个列表中的最大值。之后也可以将该函数用于任何可能的 `i32` 值的列表。

<span class="filename">文件名:src/main.rs</span>

Expand Down

0 comments on commit cdfcd55

Please sign in to comment.