From f8dcf75520c7a6c64327d084b102121681a9f70c Mon Sep 17 00:00:00 2001 From: Martin Verzilli Date: Mon, 16 Oct 2023 15:25:15 +0200 Subject: [PATCH] Use owo-colors to highlight terminal output --- Cargo.lock | 13 +------------ tooling/debugger/Cargo.toml | 2 +- tooling/debugger/src/lib.rs | 8 +++----- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3c202b9a4b7..94217c6d38e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -895,17 +895,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "colored" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" -dependencies = [ - "is-terminal", - "lazy_static", - "windows-sys 0.48.0", -] - [[package]] name = "console" version = "0.15.7" @@ -2540,10 +2529,10 @@ name = "noir_debugger" version = "0.16.0" dependencies = [ "acvm", - "colored", "easy-repl", "nargo", "noirc_printable_type", + "owo-colors", "thiserror", ] diff --git a/tooling/debugger/Cargo.toml b/tooling/debugger/Cargo.toml index 193869c8401..7e06c549d2d 100644 --- a/tooling/debugger/Cargo.toml +++ b/tooling/debugger/Cargo.toml @@ -14,4 +14,4 @@ nargo.workspace = true noirc_printable_type.workspace = true thiserror.workspace = true easy-repl = "0.2.1" -colored = "2.0.4" +owo-colors = "3" diff --git a/tooling/debugger/src/lib.rs b/tooling/debugger/src/lib.rs index ec17af4f6a3..d21eb8f6135 100644 --- a/tooling/debugger/src/lib.rs +++ b/tooling/debugger/src/lib.rs @@ -9,12 +9,10 @@ use nargo::NargoError; use nargo::ops::ForeignCallExecutor; -use thiserror::Error; - use easy_repl::{command, CommandStatus, Critical, Repl}; use std::cell::{Cell, RefCell}; -use colored::Colorize; +use owo_colors::OwoColorize; enum SolveResult { Done, @@ -81,7 +79,7 @@ impl<'backend, B: BlackBoxFunctionSolver> DebugContext<'backend, B> { } fn show_source_code_location(location: &OpcodeLocation, debug_artifact: &DebugArtifact) { - let locations = debug_artifact.debug_symbols[0].opcode_location(&location); + let locations = debug_artifact.debug_symbols[0].opcode_location(location); if let Some(locations) = locations { for loc in locations { let file = &debug_artifact.file_map[&loc.file]; @@ -92,7 +90,7 @@ impl<'backend, B: BlackBoxFunctionSolver> DebugContext<'backend, B> { println!( "\n{}{}{}\n", &source[0..start], - &source[start..end].reversed(), + &source[start..end].to_string().reversed(), &source[end..] ); }