1
Fork 0

Merge set_panic and set_print into set_output_capture.

There were no use cases for setting them separately.
Merging them simplifies some things.
This commit is contained in:
Mara Bos 2020-11-04 00:11:14 +01:00
parent 08b7cb79e0
commit aff7bd66e8
13 changed files with 57 additions and 131 deletions

View file

@ -456,15 +456,15 @@ impl Builder {
let my_packet: Arc<UnsafeCell<Option<Result<T>>>> = Arc::new(UnsafeCell::new(None));
let their_packet = my_packet.clone();
let (stdout, stderr) = crate::io::clone_io();
let output_capture = crate::io::set_output_capture(None);
crate::io::set_output_capture(output_capture.clone());
let main = move || {
if let Some(name) = their_thread.cname() {
imp::Thread::set_name(name);
}
crate::io::set_print(stdout);
crate::io::set_panic(stderr);
crate::io::set_output_capture(output_capture);
// SAFETY: the stack guard passed is the one for the current thread.
// This means the current thread's stack and the new thread's stack