1
Fork 0

Avoid naming variables str

This renames variables named `str` to other names, to make sure `str`
always refers to a type.

It's confusing to read code where `str` (or another standard type name)
is used as an identifier. It also produces misleading syntax
highlighting.
This commit is contained in:
Josh Triplett 2025-01-07 14:12:07 +02:00
parent fb546ee09b
commit bb6bbfa13f
10 changed files with 34 additions and 34 deletions

View file

@ -130,11 +130,11 @@ pub fn init_logger(cfg: LoggerConfig) -> Result<(), Error> {
let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);
match cfg.backtrace {
Ok(str) => {
Ok(backtrace_target) => {
let fmt_layer = tracing_subscriber::fmt::layer()
.with_writer(io::stderr)
.without_time()
.event_format(BacktraceFormatter { backtrace_target: str });
.event_format(BacktraceFormatter { backtrace_target });
let subscriber = subscriber.with(fmt_layer);
tracing::subscriber::set_global_default(subscriber).unwrap();
}