diff options
| author | bors <bors@rust-lang.org> | 2016-06-24 23:14:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-24 23:14:12 -0700 |
| commit | 35004b42bcd932222a4a58bf49d0d094ba397664 (patch) | |
| tree | 918b870831b7f44a0951d247b7d4bfdbe4153b6c /src/libstd/thread | |
| parent | c128e9bb2e58d7e2fe9679ac81c33a859522d5a5 (diff) | |
| parent | 0a6ce30161fddfd5148507576b761b5e4a63ba99 (diff) | |
| download | rust-35004b42bcd932222a4a58bf49d0d094ba397664.tar.gz rust-35004b42bcd932222a4a58bf49d0d094ba397664.zip | |
Auto merge of #34452 - frewsxcv:unwrap-or, r=alexcrichton
Use `Option::expect` instead of `unwrap_or_else` with `panic!`. None
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 1f78b32bcf3..d83d45518e4 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -482,9 +482,9 @@ pub struct Thread { impl Thread { // Used only internally to construct a thread object without spawning fn new(name: Option<String>) -> Thread { - let cname = name.map(|n| CString::new(n).unwrap_or_else(|_| { - panic!("thread name may not contain interior null bytes") - })); + let cname = name.map(|n| { + CString::new(n).expect("thread name may not contain interior null bytes") + }); Thread { inner: Arc::new(Inner { name: cname, |
