diff --git a/src/api/events.rs b/src/api/events.rs index 6fb5227c..4077b506 100644 --- a/src/api/events.rs +++ b/src/api/events.rs @@ -264,7 +264,7 @@ impl Engine { /// Exported under the `debugging` feature only. #[cfg(feature = "debugging")] #[inline(always)] - pub fn on_debugger( + pub fn register_debugger( &mut self, init: impl Fn() -> Dynamic + SendSync + 'static, callback: impl Fn( diff --git a/src/bin/rhai-dbg.rs b/src/bin/rhai-dbg.rs index a506b640..df668bfc 100644 --- a/src/bin/rhai-dbg.rs +++ b/src/bin/rhai-dbg.rs @@ -220,7 +220,7 @@ fn main() { // Hook up debugger let lines: Vec<_> = script.trim().split('\n').map(|s| s.to_string()).collect(); - engine.on_debugger( + engine.register_debugger( // Store the current source in the debugger state || "".into(), // Main debugging interface diff --git a/tests/debugging.rs b/tests/debugging.rs index a329a533..d0ed9cfe 100644 --- a/tests/debugging.rs +++ b/tests/debugging.rs @@ -41,7 +41,7 @@ fn test_debugging() -> Result<(), Box> { fn test_debugger_state() -> Result<(), Box> { let mut engine = Engine::new(); - engine.on_debugger( + engine.register_debugger( || { // Say, use an object map for the debugger state let mut state = Map::new();