Fix documentation for std::panic::update_hook
* `set_hook` expects a boxed function * Missing closing delimiter for the closure
This commit is contained in:
parent
bd3ac03300
commit
b9e127a830
1 changed files with 2 additions and 2 deletions
|
|
@ -215,10 +215,10 @@ pub fn take_hook() -> Box<dyn Fn(&PanicHookInfo<'_>) + 'static + Sync + Send> {
|
|||
///
|
||||
/// // Equivalent to
|
||||
/// // let prev = panic::take_hook();
|
||||
/// // panic::set_hook(move |info| {
|
||||
/// // panic::set_hook(Box::new(move |info| {
|
||||
/// // println!("...");
|
||||
/// // prev(info);
|
||||
/// // );
|
||||
/// // }));
|
||||
/// panic::update_hook(move |prev, info| {
|
||||
/// println!("Print custom message and execute panic handler as usual");
|
||||
/// prev(info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue