diff options
| author | dileepb <dileepbapat@gmail.com> | 2016-02-23 21:18:07 +0530 |
|---|---|---|
| committer | dileepb <dileepbapat@gmail.com> | 2016-02-23 21:21:51 +0530 |
| commit | fbfe70e6ab26c0cccb5fbbf5b805eecb751cb576 (patch) | |
| tree | 3cbbaa4b464bf6288f1fa9555d2a8f6b4dbd3cc8 /src/libstd/sys/windows/thread_local.rs | |
| parent | 6ffd7cd1664b70fed34861df3957ddee87ec9ad1 (diff) | |
| download | rust-fbfe70e6ab26c0cccb5fbbf5b805eecb751cb576.tar.gz rust-fbfe70e6ab26c0cccb5fbbf5b805eecb751cb576.zip | |
#31820 - Utilize `if..let` instead of single `match` branch
Diffstat (limited to 'src/libstd/sys/windows/thread_local.rs')
| -rw-r--r-- | src/libstd/sys/windows/thread_local.rs | 5 |
1 files changed, 2 insertions, 3 deletions
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<Dtor>) -> 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; } |
