Make on_print/on_debug Option.
This commit is contained in:
@@ -2219,7 +2219,7 @@ impl Engine {
|
||||
/// ```
|
||||
#[inline(always)]
|
||||
pub fn on_print(&mut self, callback: impl Fn(&str) + SendSync + 'static) -> &mut Self {
|
||||
self.print = Box::new(callback);
|
||||
self.print = Some(Box::new(callback));
|
||||
self
|
||||
}
|
||||
/// Override default action of `debug` (print to stdout using [`println!`])
|
||||
@@ -2258,7 +2258,7 @@ impl Engine {
|
||||
&mut self,
|
||||
callback: impl Fn(&str, Option<&str>, Position) + SendSync + 'static,
|
||||
) -> &mut Self {
|
||||
self.debug = Box::new(callback);
|
||||
self.debug = Some(Box::new(callback));
|
||||
self
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user