#![no_std]
#![warn(missing_docs)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::style))]
mod data;
pub use data::{Lang, DATA};
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Language {
#[cfg(feature = "lang-name")]
name: &'static str,
part1: &'static str,
part3: &'static str,
}
impl Language {
#[cfg(feature = "lang-name")]
pub const fn name(&self) -> &'static str {
self.name
}
pub const fn iso639_1(&self) -> Option<&'static str> {
if self.part1.is_empty() {
None
} else {
Some(self.part1)
}
}
pub const fn iso639_3(&self) -> &'static str {
self.part3
}
}