Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ license = "MIT"
repository = "https://github.com/pyfisch/rust-language-tags"
documentation = "http://pyfisch.github.io/rust-language-tags/language_tags/"
keywords = ["language", "internationalization", "translation", "http", "html"]

[dependencies.heapsize]
version = "0.2.2"
optional = true

[dependencies.heapsize_plugin]
version = "0.1.2"
optional = true

[features]
heap_size = ["heapsize", "heapsize_plugin"]
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![deny(missing_docs)]
#![cfg_attr(test, deny(warnings))]
#![cfg_attr(feature = "heap_size", feature(custom_derive, plugin))]
#![cfg_attr(feature = "heap_size", plugin(heapsize_plugin))]

//! Language tags can be used identify human languages, scripts e.g. Latin script, countries and
//! other regions.
Expand Down Expand Up @@ -47,6 +49,9 @@
//!
//! There is also the `langtag!` macro for creating language tags.

#[cfg(feature = "heap_size")]
extern crate heapsize;

use std::ascii::AsciiExt;
use std::cmp::Ordering;
use std::collections::{BTreeMap, BTreeSet};
Expand Down Expand Up @@ -212,6 +217,7 @@ const DEPRECATED_REGION: [(&'static str, &'static str); 6] = [("BU", "MM"),
/// but excludes languages not intended primarily for human
/// communication, such as programming languages.
#[derive(Debug, Default, Eq, Clone)]
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
pub struct LanguageTag {
/// Language subtags are used to indicate the language, ignoring all
/// other aspects such as script, region or spefic invariants.
Expand Down