From 64de20bcd35c39081e0496129269183da75fed7a Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 27 Jan 2022 16:57:00 +0800 Subject: [PATCH] Remove warnings. --- src/bin/rhai-dbg.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/rhai-dbg.rs b/src/bin/rhai-dbg.rs index a4573a4c..4395cc50 100644 --- a/src/bin/rhai-dbg.rs +++ b/src/bin/rhai-dbg.rs @@ -1,8 +1,10 @@ +#[cfg(feature = "debugging")] use rhai::{Dynamic, Engine, EvalAltResult, Position, Scope}; #[cfg(feature = "debugging")] use rhai::debugger::DebuggerCommand; +#[cfg(feature = "debugging")] use std::{ cell::RefCell, env, @@ -13,6 +15,7 @@ use std::{ }; /// Pretty-print source line. +#[cfg(feature = "debugging")] fn print_source(lines: &[String], pos: Position, offset: usize) { let line_no = if lines.len() > 1 { if pos.is_none() { @@ -40,6 +43,7 @@ fn print_source(lines: &[String], pos: Position, offset: usize) { } /// Pretty-print error. +#[cfg(feature = "debugging")] fn print_error(input: &str, mut err: EvalAltResult) { let lines: Vec<_> = input.trim().split('\n').collect(); let pos = err.take_position(); @@ -73,6 +77,7 @@ fn print_error(input: &str, mut err: EvalAltResult) { } /// Print debug help. +#[cfg(feature = "debugging")] fn print_debug_help() { println!("help => print this help"); println!("quit, exit, kill => quit"); @@ -107,6 +112,7 @@ fn print_debug_help() { } /// Display the scope. +#[cfg(feature = "debugging")] fn print_scope(scope: &Scope, dedup: bool) { let flattened_clone; let scope = if dedup {