From ffc7849f275522ab37d659a1df60c2c1dfe636c3 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 3 May 2018 03:35:46 +0200 Subject: [PATCH] avoid using NLL --- src/indexmap.rs | 6 +++++- src/lib.rs | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/indexmap.rs b/src/indexmap.rs index a200281f..f77f38b5 100644 --- a/src/indexmap.rs +++ b/src/indexmap.rs @@ -202,9 +202,13 @@ where probe_loop!(probe < self.indices.len(), { let pos = unsafe { self.indices.get_unchecked_mut(probe) }; + let mut is_none = true; // work around lack of NLL if let Some(pos) = pos.as_mut() { old_pos = mem::replace(pos, old_pos); - } else { + is_none = false; + } + + if is_none { *pos = Some(old_pos); break; } diff --git a/src/lib.rs b/src/lib.rs index fb7fd367..feb14abe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,7 +53,6 @@ #![deny(warnings)] #![feature(const_fn)] #![feature(core_intrinsics)] -#![feature(nll)] #![feature(nonzero)] #![feature(untagged_unions)] #![no_std]