From b6070a6fa4cde012028f6d74c94436c86d79df43 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 23 Jun 2024 01:59:12 -0700 Subject: deprecate ShowContextual, document changes to colors/color_new modules --- src/lib.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 3af5f00..f5b6ea6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,14 @@ #![no_std] #![doc = include_str!("../README.md")] +#[cfg(feature = "alloc")] +extern crate alloc; + use core::fmt::{self, Debug, Display}; use core::hash::Hash; #[cfg(feature="use-serde")] #[macro_use] extern crate serde_derive; - #[cfg(feature="use-serde")] use serde::{Serialize, Deserialize}; @@ -18,24 +20,22 @@ pub use address::AddrParse; pub mod annotation; +#[deprecated(since="0.3.0", note="yaxpeax_arch::color conflates output mechanism and styling, leaving it brittle and overly-restrictive. see `yaxpeax_arch::color_new`, which will replace `color` in a future version.")] mod color; +#[allow(deprecated)] // allow exporting the deprecated items here to not break downstreams even further... pub use color::{Colorize, NoColors, YaxColors}; - -#[cfg(feature="colors")] -pub use color::ColorSettings; - -#[cfg(feature = "alloc")] -extern crate alloc; +#[cfg(feature="color-new")] +pub mod color_new; pub mod display; -pub mod testkit; - mod reader; pub use reader::{Reader, ReaderBuilder, ReadError, U8Reader, U16le, U16be, U32le, U32be, U64le, U64be}; pub mod safer_unchecked; +pub mod testkit; + /// the minimum set of errors a `yaxpeax-arch` disassembler may produce. /// /// it is permissible for an implementer of `DecodeError` to have items that return `false` for @@ -235,6 +235,8 @@ pub trait Instruction { fn well_defined(&self) -> bool; } +#[allow(deprecated)] +#[deprecated(since="0.3.0", note="ShowContextual ties YaxColors and fmt::Write in a way that only sometimes composes. simultaneously, it is too generic on Ctx, making it difficult to implement and use. it will be revisited in the future.")] pub trait ShowContextual { fn contextualize(&self, colors: &Y, address: Addr, context: Option<&Ctx>, out: &mut T) -> fmt::Result; } -- cgit v1.1