Skip to content

Commit

Permalink
Auto merge of rust-lang#34452 - frewsxcv:unwrap-or, r=alexcrichton
Browse files Browse the repository at this point in the history
Use `Option::expect` instead of `unwrap_or_else` with `panic!`.

None
  • Loading branch information
bors authored Jun 25, 2016
2 parents c128e9b + 0a6ce30 commit 35004b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libstd/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 35004b4

Please sign in to comment.