Skip to content

Commit

Permalink
add debug impl for Localizer
Browse files Browse the repository at this point in the history
  • Loading branch information
tronicboy1 committed Feb 22, 2024
1 parent e15a6de commit 7dbe8a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "axum_l10n"
version = "0.2.5"
version = "0.2.6"
edition = "2021"
authors = ["tronicboy1"]
description = "A crate with localization utilities for Axum"
Expand Down
14 changes: 14 additions & 0 deletions src/fluent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ pub struct Localizer {
number_options: FluentNumberOptions,
}

impl std::fmt::Debug for Localizer {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"Localizer - {}",
self.locales
.keys()
.map(|k| k.to_string())
.collect::<Vec<String>>()
.join(", ")
)
}
}

#[derive(Debug)]
pub struct LocalizerError {
cause: String,
Expand Down

0 comments on commit 7dbe8a4

Please sign in to comment.