From 6ee8a1e47650a2f058b9d7fbc03588177182f4c0 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 15 Jun 2015 15:50:23 +0200 Subject: [PATCH] Use pop() better in cef_string_multimap_clear. --- ports/cef/string_multimap.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/cef/string_multimap.rs b/ports/cef/string_multimap.rs index 49897b0cd3c..d7f8fb2c9c8 100644 --- a/ports/cef/string_multimap.rs +++ b/ports/cef/string_multimap.rs @@ -121,9 +121,8 @@ pub extern "C" fn cef_string_multimap_clear(smm: *mut cef_string_multimap_t) { if smm.is_null() { return; } if (*smm).len() == 0 { return; } for (_, val) in (*smm).iter_mut() { - while (*val).len() != 0 { - let cs = (*val).pop(); - cef_string_userfree_utf16_free(cs.unwrap()); + while let Some(cs) = (*val).pop() { + cef_string_userfree_utf16_free(cs); } } (*smm).clear();