Skip to main content

redact

Function redact 

Source
fn redact(token: &str, s: String) -> String
Expand description

Strips the bot token out of an error message before it’s ever logged or returned. reqwest::Error’s Display embeds the request URL on send/connection failures, and the URL contains bot{token} — so {e} must never reach a log line or a Result<_, String> unredacted. This is the single choke point every error-construction site routes through, so callers can’t accidentally skip it.