diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-03-05 22:04:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-05 22:04:05 +0100 |
| commit | 22a743bc1c242b539cd70116068e62b1bd686a10 (patch) | |
| tree | 50e7c4bc9bd8192437d49371a4dfc5530bbf00eb /src/librustc_mir/interpret | |
| parent | 189626672d4a8a838643ed612e568403aec27701 (diff) | |
| parent | 80ed505c41319f2fbbc7e97189e62b38c47b5a70 (diff) | |
| download | rust-22a743bc1c242b539cd70116068e62b1bd686a10.tar.gz rust-22a743bc1c242b539cd70116068e62b1bd686a10.zip | |
Rollup merge of #69713 - matthiaskrgr:more_cleanup, r=cramertj
more clippy cleanups
* Don't use .ok() before unwrapping via .expect() on a Result.
* Use .map() to modify data inside Options instead of using .and_then(|x| Some(y))
* Use .as_deref() instead of .as_ref().map(Deref::deref)
* Don't use "if let" bindings to only check a value and not actually bind anything.
* Use single-char patter on {ends,starts}_with and remove clone on copy type.
Diffstat (limited to 'src/librustc_mir/interpret')
| -rw-r--r-- | src/librustc_mir/interpret/memory.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index 6517ae5d0f3..3c4a1857f96 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -565,7 +565,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { // # Function pointers // (both global from `alloc_map` and local from `extra_fn_ptr_map`) - if let Some(_) = self.get_fn_alloc(id) { + if self.get_fn_alloc(id).is_some() { return if let AllocCheck::Dereferenceable = liveness { // The caller requested no function pointers. throw_unsup!(DerefFunctionPointer) |
