Sha256: 894d0f73836d99915c5726d8984e7833498e841e2985cedfd5893aeb2bdcc958

Contents?: true

Size: 695 Bytes

Versions: 3

Compression:

Stored size: 695 Bytes

Contents

// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use crate::LanguageIdentifier;
use alloc::string::ToString;
use databake::*;

impl Bake for LanguageIdentifier {
    fn bake(&self, env: &CrateEnv) -> TokenStream {
        env.insert("icu_locid");
        let repr = self.to_string();
        if self.variants.len() <= 1 {
            quote! {
                icu_locid::langid!(#repr)
            }
        } else {
            quote! {
                icu_locid::LanguageIdentifier::from_str(#repr).unwrap()
            }
        }
    }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/icu_locid-1.5.0/src/databake.rs
wasmtime-28.0.0 ./ext/cargo-vendor/icu_locid-1.5.0/src/databake.rs
wasmtime-27.0.0 ./ext/cargo-vendor/icu_locid-1.5.0/src/databake.rs