@@ -715,15 +715,15 @@ <h2 id="特别鸣谢"><a class="header" href="#特别鸣谢">特别鸣谢</a></h
715
715
</li>
716
716
<li><code>to_</code>
717
717
<ul>
718
- <li>[<code>Path::to_str</code>] ( https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.to_str)
718
+ <li><a href=" https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.to_str"><code>Path::to_str</code></a>
719
719
对操作系统路径进行 UTF-8 字节检查,开销昂贵。
720
720
虽然输入和输出都是借用,但是这个方法对运行时产生不容忽视的代价,
721
721
所以不应使用 <code>as_str</code> 名称。</li>
722
- <li>[<code>str::to_lowercase()</code>] ( https://doc.rust-lang.org/std/primitive.str.html#method.to_lowercase)
722
+ <li><a href=" https://doc.rust-lang.org/std/primitive.str.html#method.to_lowercase"><code>str::to_lowercase()</code></a>
723
723
生成正确的 Unicode 小写字符,
724
724
涉及遍历字符串的字符,可能需要分配内存。
725
725
输入值是 <code>&str</code> 类型,输出值是 <code>String</code> 类型。</li>
726
- <li>[<code>f64::to_radians()</code>] ( https://doc.rust-lang.org/std/primitive.f64.html#method.to_radians)
726
+ <li><a href=" https://doc.rust-lang.org/std/primitive.f64.html#method.to_radians"><code>f64::to_radians()</code></a>
727
727
把浮点数的角度制转换成弧度制。
728
728
输入和输出都是 <code>f64</code> 。没必要传入 <code>&f64</code> ,因为复制 <code>f64</code> 花销很小。
729
729
但是使用 <code>into_radians</code> 名称就会具有误导性,因为输入数据没有被消耗。</li>
@@ -734,10 +734,10 @@ <h2 id="特别鸣谢"><a class="header" href="#特别鸣谢">特别鸣谢</a></h
734
734
<li><a href="https://doc.rust-lang.org/std/string/struct.String.html#method.into_bytes"><code>String::into_bytes()</code></a>
735
735
从 <code>String</code> 提取出背后的 <code>Vec<u8></code> 数据,这是无代价的。
736
736
它转移了 <code>String</code> 的所有权,然后返回具有所有权的 <code>Vec<u8></code> 。</li>
737
- <li>[<code>BufReader::into_inner()</code>] ( https://doc.rust-lang.org/std/io/struct.BufReader.html#method.into_inner)
737
+ <li><a href=" https://doc.rust-lang.org/std/io/struct.BufReader.html#method.into_inner"><code>BufReader::into_inner()</code></a>
738
738
转移了 buffered reader 的所有权,取出其背后的 reader ,这是无代价的。
739
739
存于缓冲区的数据被丢弃了。</li>
740
- <li>[<code>BufWriter::into_inner()</code>] ( https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.into_inner)
740
+ <li><a href=" https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.into_inner"><code>BufWriter::into_inner()</code></a>
741
741
转移了 buffered writer 的所有权,取出其背后的 writer ,这可能以很大的代价刷新所有缓存数据。</li>
742
742
</ul>
743
743
</li>
0 commit comments