Experimenting with more structured ways to handle command-line input/output in Rust
use fluent_embed::Localize;
use icu_locale::LanguageIdentifier;

pub fn compare_message<L: Localize<Vec<u8>>, S: AsRef<str>>(
    message: L,
    expected: S,
    locale: LanguageIdentifier,
) {
    let mut buffer = Vec::new();
    message.message_for_locale(&mut buffer, &locale).unwrap();
    let result = String::from_utf8(buffer).unwrap();

    pretty_assertions::assert_eq!(result, expected.as_ref());
}