From fbfe70e6ab26c0cccb5fbbf5b805eecb751cb576 Mon Sep 17 00:00:00 2001 From: dileepb Date: Tue, 23 Feb 2016 21:18:07 +0530 Subject: #31820 - Utilize `if..let` instead of single `match` branch --- src/libstd/sys/windows/thread_local.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/windows/thread_local.rs b/src/libstd/sys/windows/thread_local.rs index db2ad1d89c4..386d21a04c7 100644 --- a/src/libstd/sys/windows/thread_local.rs +++ b/src/libstd/sys/windows/thread_local.rs @@ -69,9 +69,8 @@ static mut DTORS: *mut Vec<(Key, Dtor)> = ptr::null_mut(); pub unsafe fn create(dtor: Option) -> Key { let key = c::TlsAlloc(); assert!(key != c::TLS_OUT_OF_INDEXES); - match dtor { - Some(f) => register_dtor(key, f), - None => {} + if let Some(f) = dtor { + register_dtor(key, f); } return key; } -- cgit 1.4.1-3-g733a5