We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Option::expect
unwrap_or_else
panic!
1 parent 8c63d12 commit 0a6ce30Copy full SHA for 0a6ce30
src/libstd/thread/mod.rs
@@ -482,9 +482,9 @@ pub struct Thread {
482
impl Thread {
483
// Used only internally to construct a thread object without spawning
484
fn new(name: Option<String>) -> Thread {
485
- let cname = name.map(|n| CString::new(n).unwrap_or_else(|_| {
486
- panic!("thread name may not contain interior null bytes")
487
- }));
+ let cname = name.map(|n| {
+ CString::new(n).expect("thread name may not contain interior null bytes")
+ });
488
Thread {
489
inner: Arc::new(Inner {
490
name: cname,
0 commit comments