Merge pull request #814 from sweet2honey/main

Squashed commit: fix typo.
pull/815/head
Sunface 3 years ago committed by GitHub
commit b91764526b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -451,7 +451,7 @@ error: `..` can only be used once per tuple pattern // 每个元组模式只能
error: could not compile `world_hello` due to previous error ^^ error: could not compile `world_hello` due to previous error ^^
``` ```
Rust 无法判断,`second` 应该匹配 `numbers` 中的第几个元素,因此这里使用两个 `..` 模式,是很大歧义的! Rust 无法判断,`second` 应该匹配 `numbers` 中的第几个元素,因此这里使用两个 `..` 模式,是很大歧义的!
### 匹配守卫提供的额外条件 ### 匹配守卫提供的额外条件

@ -92,7 +92,6 @@ enum IpAddr {
} }
fn main() { fn main() {
// let d_panic = Direction::South;
let ip1 = IpAddr::Ipv6; let ip1 = IpAddr::Ipv6;
let ip_str = match ip1 { let ip_str = match ip1 {
IpAddr::Ipv4 => "127.0.0.1", IpAddr::Ipv4 => "127.0.0.1",

Loading…
Cancel
Save