about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/json.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-10 03:55:16 +0000
committerbors <bors@rust-lang.org>2022-06-10 03:55:16 +0000
commit52ee2a2738c957ca6fd54e97b4e090a266ba96ba (patch)
treef7bcbf573947f0550f1d0004512fcc151bdf0c64 /compiler/rustc_errors/src/json.rs
parente9aff9c42cb94974dc80e3c5ae3d2727eaae9682 (diff)
parenta3c30e440a7a2cb36b6d8d405fdf7d5d50110903 (diff)
downloadrust-52ee2a2738c957ca6fd54e97b4e090a266ba96ba.tar.gz
rust-52ee2a2738c957ca6fd54e97b4e090a266ba96ba.zip
Auto merge of #95770 - nrc:read-buf-builder, r=joshtriplett
std::io: Modify some ReadBuf method signatures to return `&mut Self`

This allows using `ReadBuf` in a builder-like style and to setup a `ReadBuf` and
pass it to `read_buf` in a single expression, e.g.,

```
// With this PR:
reader.read_buf(ReadBuf::uninit(buf).assume_init(init_len))?;

// Previously:
let mut buf = ReadBuf::uninit(buf);
buf.assume_init(init_len);
reader.read_buf(&mut buf)?;
```

r? `@sfackler`

cc https://github.com/rust-lang/rust/issues/78485, https://github.com/rust-lang/rust/issues/94741
Diffstat (limited to 'compiler/rustc_errors/src/json.rs')
0 files changed, 0 insertions, 0 deletions