diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-07-04 01:38:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-04 01:38:46 +0200 |
| commit | 88c007cd0418e92bbacb8a46d9f9b23422da0d56 (patch) | |
| tree | f0b6b549f2d818d2e12a6b38eebe6c74e026d536 /src/libstd/sync | |
| parent | 6cfd474e3337934da9606844e6cf571f96d9652b (diff) | |
| parent | eddfad31400b9c6cba6eda95cadd96c455504898 (diff) | |
| download | rust-88c007cd0418e92bbacb8a46d9f9b23422da0d56.tar.gz rust-88c007cd0418e92bbacb8a46d9f9b23422da0d56.zip | |
Rollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-default, r=dtolnay,Centril
Use mem::take instead of mem::replace with default
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mpsc/sync.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs index 3c4f8e077c9..f8fcd3ff5a5 100644 --- a/src/libstd/sync/mpsc/sync.rs +++ b/src/libstd/sync/mpsc/sync.rs @@ -383,7 +383,7 @@ impl<T> Packet<T> { // needs to be careful to destroy the data *outside* of the lock to // prevent deadlock. let _data = if guard.cap != 0 { - mem::replace(&mut guard.buf.buf, Vec::new()) + mem::take(&mut guard.buf.buf) } else { Vec::new() }; |
