Change on_debugger to register_debugger.

This commit is contained in:
Stephen Chung 2022-02-01 14:07:06 +08:00
parent 389bb9bf66
commit dca0185323
3 changed files with 3 additions and 3 deletions

View File

@ -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(

View File

@ -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

View File

@ -41,7 +41,7 @@ fn test_debugging() -> Result<(), Box<EvalAltResult>> {
fn test_debugger_state() -> Result<(), Box<EvalAltResult>> {
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();