Merge pull request #434 from Nangos/patch-24

Update ch12-06-writing-to-stderr-instead-of-stdout.md
This commit is contained in:
KaiserY 2020-07-11 17:37:28 +08:00 committed by GitHub
commit 20a1251c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
## 将错误信息输出到标准错误而不是标准输出 ## 将错误信息输出到标准错误而不是标准输出
> [ch12-06-writing-to-stderr-instead-of-stdout.md](https://github.com/rust-lang/book/blob/master/src/ch12-06-writing-to-stderr-instead-of-stdout.md) > [ch12-06-writing-to-stderr-instead-of-stdout.md](https://github.com/rust-lang/book/blob/master/src/ch12-06-writing-to-stderr-instead-of-stdout.md)
> <br> > <br>
@ -26,7 +26,7 @@ $ cargo run > output.txt
Problem parsing arguments: not enough arguments Problem parsing arguments: not enough arguments
``` ```
是的,错误信息被打印到了标准输出中。像这样的错误信息被打印到标准错误中将会有用的多,并且只将成功运行的信息写入文件。接下来我们将对程序进行修改从而以这种方式进行输出 是的,错误信息被打印到了标准输出中。像这样的错误信息被打印到标准错误中将会有用得多,将使得只有成功运行所产生的输出才会写入文件。我们接下来就修改
### 将错误打印到标准错误 ### 将错误打印到标准错误