We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c128e9b + 0a6ce30 commit 35004b4Copy full SHA for 35004b4
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