about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-01-14 18:00:00 +0000
committerGitHub <noreply@github.com>2021-01-14 18:00:00 +0000
commit9fc298ca894204fc9699f8989b2d3f1bf425d583 (patch)
tree1b34c596a8c8c9b034cf1c4aa05e0a14bdb7193e /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent930371b3ae7aae262f62363c8c77d4903742c210 (diff)
parent746329201546d38875bf1a7fa232453e833c01eb (diff)
downloadrust-9fc298ca894204fc9699f8989b2d3f1bf425d583.tar.gz
rust-9fc298ca894204fc9699f8989b2d3f1bf425d583.zip
Rollup merge of #80217 - camelid:io-read_to_string, r=m-ou-se
Add a `std::io::read_to_string` function

I recognize that you're usually supposed to open an issue first, but the
implementation is very small so it's okay if this is closed and it was 'wasted
work' :)

-----

The equivalent of `std::fs::read_to_string`, but generalized to all
`Read` impls.

As the documentation on `std::io::read_to_string` says, the advantage of
this function is that it means you don't have to create a variable first
and it provides more type safety since you can only get the buffer out
if there were no errors. If you use `Read::read_to_string`, you have to
remember to check whether the read succeeded because otherwise your
buffer will be empty.

It's friendlier to newcomers and better in most cases to use an explicit
return value instead of an out parameter.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions