Skip to content

Commit b857dd4

Browse files
authored
fix URL format for G.NAM.02 (#131)
1 parent 4f99b36 commit b857dd4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/safe-guides/code_style/naming/G.NAM.02.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@
3131
- [`str::as_bytes()`](https://doc.rust-lang.org/std/primitive.str.html#method.as_bytes)
3232
用于查看 UTF-8 字节的 `str` 切片,这是无内存代价的(不会产生内存分配)。 传入值是 `&str` 类型,输出值是 `&[u8]` 类型。
3333
- `to_`
34-
- [`Path::to_str`] (https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.to_str)
34+
- [`Path::to_str`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.to_str)
3535
对操作系统路径进行 UTF-8 字节检查,开销昂贵。
3636
虽然输入和输出都是借用,但是这个方法对运行时产生不容忽视的代价,
3737
所以不应使用 `as_str` 名称。
38-
- [`str::to_lowercase()`] (https://doc.rust-lang.org/std/primitive.str.html#method.to_lowercase)
38+
- [`str::to_lowercase()`](https://doc.rust-lang.org/std/primitive.str.html#method.to_lowercase)
3939
生成正确的 Unicode 小写字符,
4040
涉及遍历字符串的字符,可能需要分配内存。
4141
输入值是 `&str` 类型,输出值是 `String` 类型。
42-
- [`f64::to_radians()`] (https://doc.rust-lang.org/std/primitive.f64.html#method.to_radians)
42+
- [`f64::to_radians()`](https://doc.rust-lang.org/std/primitive.f64.html#method.to_radians)
4343
把浮点数的角度制转换成弧度制。
4444
输入和输出都是 `f64` 。没必要传入 `&f64` ,因为复制 `f64` 花销很小。
4545
但是使用 `into_radians` 名称就会具有误导性,因为输入数据没有被消耗。
4646
- `into_`
4747
- [`String::into_bytes()`](https://doc.rust-lang.org/std/string/struct.String.html#method.into_bytes)
4848
`String` 提取出背后的 `Vec<u8>` 数据,这是无代价的。
4949
它转移了 `String` 的所有权,然后返回具有所有权的 `Vec<u8>`
50-
- [`BufReader::into_inner()`] (https://doc.rust-lang.org/std/io/struct.BufReader.html#method.into_inner)
50+
- [`BufReader::into_inner()`](https://doc.rust-lang.org/std/io/struct.BufReader.html#method.into_inner)
5151
转移了 buffered reader 的所有权,取出其背后的 reader ,这是无代价的。
5252
存于缓冲区的数据被丢弃了。
53-
- [`BufWriter::into_inner()`] (https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.into_inner)
53+
- [`BufWriter::into_inner()`](https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.into_inner)
5454
转移了 buffered writer 的所有权,取出其背后的 writer ,这可能以很大的代价刷新所有缓存数据。
5555

5656
如果类型转换方法返回的类型具有 `mut` 修饰,那么这个方法的名称应如同返回类型组成部分的顺序那样,带有 `mut`
@@ -68,4 +68,4 @@
6868

6969
| lint name | Clippy 可检测 | Rustc 可检测 | Lint Group | Lint Level |
7070
| ------ | ---- | --------- | ------ | ------ |
71-
| [wrong_self_convention](https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention) | yes| no | Style | warn |
71+
| [wrong_self_convention](https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention) | yes| no | Style | warn |

0 commit comments

Comments
 (0)