From 4353d5ce5cda85c4899a206cdf4cace1cae7d030 Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:48:31 +0000 Subject: [PATCH] Remove dead code from bun_core: the function form of pretty_errorln bun_core::output::pretty_errorln (the function) has no caller. Its last callers went away in #46021. The macro pretty_errorln! stays. The clippy.toml row that names the function goes with it. Without the function the row resolves to the macro and clippy warns "expected a function, found a macro". --- clippy.toml | 1 - src/bun_core/output.rs | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/clippy.toml b/clippy.toml index bf4d170052de..454f9b436d14 100644 --- a/clippy.toml +++ b/clippy.toml @@ -25,7 +25,6 @@ disallowed-methods = [ { path = "bun_core::output::pretty_fmt_runtime", reason = "const format strings must use pretty_fmt!/write_pretty! (compile-time rewrite); the runtime walk is only for templates built at runtime — allow with justification" }, { path = "bun_core::output::pretty", reason = "renders args then tag-walks the rendered bytes (allocates twice, mangles user-controlled '<'); use the pretty! macro — allow only for runtime-built payloads, with justification" }, { path = "bun_core::output::prettyln", reason = "renders args then tag-walks the rendered bytes; use the prettyln! macro — allow only for runtime-built payloads, with justification" }, - { path = "bun_core::output::pretty_errorln", reason = "renders args then tag-walks the rendered bytes; use the pretty_errorln! macro — allow only for runtime-built payloads, with justification" }, { path = "bun_core::output::warn", reason = "renders args then tag-walks the rendered bytes; use the warn! macro — allow only for runtime-built payloads, with justification" }, { path = "bun_core::output::debug_warn", reason = "renders args then tag-walks the rendered bytes; use the debug_warn! macro — allow only for runtime-built payloads, with justification" }, { path = "alloc::string::String::from_utf8", reason = "keep data as bytes; for display use bstr::BStr, for JS-visible strings use bun_core::String::clone_utf8" }, diff --git a/src/bun_core/output.rs b/src/bun_core/output.rs index 27f6012c8bc7..38a46a8cb6dd 100644 --- a/src/bun_core/output.rs +++ b/src/bun_core/output.rs @@ -184,19 +184,6 @@ pub fn warn(payload: impl PrettyFmtInput) { flush(); } -/// `Output.prettyErrorln` — function form. Performs `` → ANSI rewrite on -/// the rendered payload (using stderr's colour state), writes to stderr, and -/// appends `\n` if the rendered output does not already end in one. Macro -/// form: `crate::pretty_errorln!`. -#[inline] -pub fn pretty_errorln(payload: impl PrettyFmtInput) { - let buf = payload.into_pretty_buf(enable_ansi_colors_stderr()); - write_bytes(Destination::Stderr, &buf); - if buf.0.last() != Some(&b'\n') { - write_bytes(Destination::Stderr, b"\n"); - } -} - /// `bun.Output.Source.Stdio.restore` — restore terminal to cooked mode on exit. /// Thin alias over [`crate::output::stdio::restore`] (the real impl, also in /// this crate).