Update Ch21

This commit is contained in:
Unisko PENG 2023-04-07 16:23:12 +08:00
parent e231bafcf5
commit 905fc6b7bd
2 changed files with 6 additions and 6 deletions

View File

@ -36,7 +36,7 @@ fn main() {
```console
$ cargo run
$ cargo run
Compiling error_handling_demo v0.1.0 (/home/lenny/rust-lang/error_handling_demo)
Finished dev [unoptimized + debuginfo] target(s) in 0.40s
Running `target/debug/error_handling_demo`
@ -229,7 +229,7 @@ fn main() {
Err(e) => match e.kind() {
ErrorKind::NotFound => match File::create("hello.txt") {
Ok(fc) => fc,
Err(error) => panic! ("创建该文件时出现问题:{:?}", error),
Err(error) => panic! ("创建该文件时出现问题:{:?}", error),
},
other_error => panic! ("打开文件出现问题:{:?}", other_error),
},

View File

@ -173,10 +173,10 @@ fn main() {
| `@` | `ident @ pat` | 模式绑定 | |
| `^` | `var ^ expr` | 按位异或运算 | `BitXor` |
| `^=` | `var ^= expr` | 按位异或运算并赋值 | `BitXorAssign` |
| `\|` | `pat | pat` | 模式选择pattern alternatives | |
| `\|` | `expr | expr` | 按位或运算 | `BitOr` |
| `\|=` | `var |= expr` | 按位或运算并赋值 | `BitOrAssign` |
| `\|\|` | `expr || expr` | 短路逻辑或运算 | |
| <code>|</code> | <code>pat | pat</code> | 模式选择pattern alternatives | |
| <code>|</code> | <code>expr | expr</code> | 按位或运算 | `BitOr` |
| <code>|=</code> | <code>var |= expr</code> | 按位或运算并赋值 | `BitOrAssign` |
| <code>||</code> | <code>expr || expr</code> | 短路逻辑或运算 | |
| `?` | `expr?` | 错误传递 | |
### 非运算符的符号