about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-11-07 16:17:03 +0100
committerSimon Sapin <simon.sapin@exyr.org>2017-11-07 17:52:07 +0100
commitfd518ac4b0fe30b13d2fdf0f1b4b9fa129d75dff (patch)
treea95f09bcd8812dd94a7cf8d180d8847eb295e441 /src/libstd/sys/unix/stack_overflow.rs
parent3e7f501991df2f7fc87f6c340945112c128735d2 (diff)
downloadrust-fd518ac4b0fe30b13d2fdf0f1b4b9fa129d75dff.tar.gz
rust-fd518ac4b0fe30b13d2fdf0f1b4b9fa129d75dff.zip
Add File::read_contents and File::write_contents convenience functions.
Before:

```rust
use std::fs::File;
use std::io::Read;

let mut bytes = Vec::new();
File::open(filename)?.read_to_end(&mut bytes)?;
do_something_with(bytes)
```

After:

```rust
use std::fs::File;

do_something_with(File::read_contents(filename)?)
```
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions