Bug 1878375 - Synchronize vendored Rust libraries with mozilla-central. r=mkmelin

mozilla-central: 169a59fe35f8b31a236c9bf717a5887b51ea6757
comm-central: 1c28de9edd1bca153e8029cd2aa59a61a5bd0e12

Differential Revision: https://phabricator.services.mozilla.com/D221779

--HG--
extra : amend_source : 8e2ba4b80edf92a1f8ff080f25d9529adb554670
This commit is contained in:
Thunderbird Updatebot 2024-09-11 13:44:29 +03:00
Родитель b0b1c9cf3e
Коммит f2f27c59f4
23 изменённых файлов: 10015 добавлений и 908 удалений

8
rust/Cargo.lock сгенерированный
Просмотреть файл

@ -5352,9 +5352,9 @@ dependencies = [
[[package]] [[package]]
name = "unic-langid" name = "unic-langid"
version = "0.9.1" version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "398f9ad7239db44fd0f80fe068d12ff22d78354080332a5077dc6f52f14dcf2f" checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44"
dependencies = [ dependencies = [
"unic-langid-impl", "unic-langid-impl",
] ]
@ -5370,9 +5370,9 @@ dependencies = [
[[package]] [[package]]
name = "unic-langid-impl" name = "unic-langid-impl"
version = "0.9.1" version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e35bfd2f2b8796545b55d7d3fd3e89a0613f68a0d1c8bc28cb7ff96b411a35ff" checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5"
dependencies = [ dependencies = [
"tinystr", "tinystr",
] ]

Просмотреть файл

@ -1 +1 @@
{"mc_workspace_toml": "b47b79a7c73ee991c81850c7069696c57b4e1593443043f9c025f59260d6469d5754f552d8cea2c747c0be1ce0da1517e57aa37c42207e03b21d90e0ed295ab1", "mc_gkrust_toml": "522d8c92ca3a3c089a1479dc20cc9015c16a1f550579346c328a46fd74ffc3e957656bb445cd3cade971a8fbf892dfe47ea73d7f7153ba59de5a2ac68357739b", "mc_hack_toml": "d76ce395d170433ad163ba7bd0d83a02fdc6c831287315a099d070348e2eb00f8f08da1d9a5fe135925865457a635954c216229ef0abd178a03f0922ebbc890e", "mc_cargo_lock": "f8832397cd101fa342420f67ebb9b1ab7084c2e161cb72c4edf93077a839f12effd3e69fb44e899cb98d166e21ba10e7758777a25c1652356b6ee212f344834a"} {"mc_workspace_toml": "b47b79a7c73ee991c81850c7069696c57b4e1593443043f9c025f59260d6469d5754f552d8cea2c747c0be1ce0da1517e57aa37c42207e03b21d90e0ed295ab1", "mc_gkrust_toml": "522d8c92ca3a3c089a1479dc20cc9015c16a1f550579346c328a46fd74ffc3e957656bb445cd3cade971a8fbf892dfe47ea73d7f7153ba59de5a2ac68357739b", "mc_hack_toml": "d76ce395d170433ad163ba7bd0d83a02fdc6c831287315a099d070348e2eb00f8f08da1d9a5fe135925865457a635954c216229ef0abd178a03f0922ebbc890e", "mc_cargo_lock": "95bfba5dc7532e7d113798758aca1e925cb4b2ce5c0d53874d7025d01afe1312d03a026ad10abecad816f38d3383a68e8382b97ac9a268223724d66adb5094a2"}

Просмотреть файл

@ -16,8 +16,8 @@ harness = false
[dependencies] [dependencies]
mozilla-central-workspace-hack = { version = "0.1", features = ['gkrust'], optional = true } mozilla-central-workspace-hack = { version = "0.1", features = ['gkrust'], optional = true }
gkrust-shared = { version = "0.1.0", path = "../../../toolkit/library/rust/shared" } gkrust-shared = { version = "0.1.0", path = "../../../toolkit/library/rust/shared" }
ews_xpcom = { version = "0.1.0", path = "../ews_xpcom" }
sys_tray = { version = "0.1.0", path = "../sys_tray" } sys_tray = { version = "0.1.0", path = "../sys_tray" }
ews_xpcom = { version = "0.1.0", path = "../ews_xpcom" }
aa-stroke = { git = "https://github.com/FirefoxGraphics/aa-stroke", rev = "d94278ed9c7020f50232689a26d1277eb0eb74d2" } aa-stroke = { git = "https://github.com/FirefoxGraphics/aa-stroke", rev = "d94278ed9c7020f50232689a26d1277eb0eb74d2" }
app_services_logger = { path = "../../../services/common/app_services_logger" } app_services_logger = { path = "../../../services/common/app_services_logger" }
audio_thread_priority = { version = "0.32" } audio_thread_priority = { version = "0.32" }

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.lock":"da3d5fabc92472ac1f45fa321f1e188fd3fff22b3234d3f74e78a8f79503aac9","Cargo.toml":"67560e144c925cdb1467085067b51138da8461c4babd170777e90082a1664d61","README.md":"1ce686b1ba46e7fff771db934d1e8905e3d96c73d9e6712ca85011cf63cf4157","benches/canonicalize.rs":"1bc9db6454ed711c1c1d58a9236d1ed02c40645782338697812dc21b26c2295f","benches/langid.rs":"46dc68e1ee1c998fe957035c11c373cc5d2c2993dd3058aeb36014028618a46e","benches/likely_subtags.rs":"33debb6db4eabd0166525c7c06868f86e35958c2d0d9e5e7668f28b1aff3da23","benches/parser.rs":"bc5460589125aca2ca4c4cf475fde81e7de6aa70c7bf8443996b6246b44110a3","data/cldr-misc-full/README.md":"b4bbc8e56b8c9f5d482d2dd211e53720cdca27b0e98eec274e56577d41906b92","src/bin/generate_layout.rs":"e1df742c318ba4de09a25edad082a398da1d5591ac24074f9eadf3f40d677a9a","src/bin/generate_likelysubtags.rs":"9b0df3a008d0f6090ee441e4c649f00f9b78c7d23434f389fe3de2288951cf72","src/errors.rs":"091525fd3d704cc4698bab82af9fff1f2e6fc793910700790ec3ef943b3eddfe","src/layout_table.rs":"c311b5399a22efd69f14decb00aee7dfb2943a090832e2aef127e2853ad1ce0b","src/lib.rs":"75b5e8958ba0139ef60139e61441d29c80bde8552d1adead3905165c11ed97cd","src/likelysubtags/mod.rs":"66889568b883675465faa445e257b4b70e9dcba98c6c523eb34a08ebb50377c0","src/likelysubtags/tables.rs":"47ab40497145adc553f9f585d1ec79d01028495a57b1907392642afd26986e89","src/parser/errors.rs":"2dacf5bf388499c9fbecf64ef950038f123335e87b6691bcdb88d185678f38d5","src/parser/mod.rs":"30f9ff487ab7b023ec7e6cfbfe4f4ebc41ca524cef0eba96a6b77ad624c9f6b8","src/serde.rs":"2ce1fdea1217c4f72b2c8e00f333902ff496c54eef5b4534adb289375c50aef0","src/subtags/language.rs":"ea198788c10a9b24a88d2316d516a1b6325b20c57c1d05586edc7c50acc1e27d","src/subtags/mod.rs":"ba23712d7ce5e0fa896c97ddc91d7eacbf21a99d62c15f5cf19a6653876bf56b","src/subtags/region.rs":"f3455679067ed0da9103d5433586cb4809628847e923bbcf35cc2d2b25a0d35e","src/subtags/script.rs":"c5ca9a2ab6d8b3a1dc3f52a73665223f0dd30901b8e5d722dd93e58a69710f5d","src/subtags/variant.rs":"a0feec8b44933ff04a3d3f91e9e69f7537468e7c813c3780eb87e51512f6d1dd","tests/canonicalize_test.rs":"5ca005223ae159c15f8809c28c1cc950dc4d69063d9de70b885f18ef8e6cca28","tests/fixtures.rs":"d03a280b67080dac1bc333255e89d8903164688a6dfaed5adbea68efd65ef1bc","tests/language_identifier_test.rs":"90a4d7ac4961c1e214de166036c1b5cae21f3a99f157fe00d149d8b9106cb7b9","tests/likelysubtags.rs":"f5db0c3ec9f545eef148914486c7a74f1bbc629f4dcff3077242c174c0c1c6a3"},"package":"e35bfd2f2b8796545b55d7d3fd3e89a0613f68a0d1c8bc28cb7ff96b411a35ff"} {"files":{"Cargo.lock":"532630f4d7eb8eae673c8204b236010b0ee5c73711f5ff62c54d7abba28a6583","Cargo.toml":"58027bfb79e1d2fc0aec2d3d27a3fdc7ca892d682afd3f5f62b8c2fb0150198c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"1ce686b1ba46e7fff771db934d1e8905e3d96c73d9e6712ca85011cf63cf4157","benches/canonicalize.rs":"1bc9db6454ed711c1c1d58a9236d1ed02c40645782338697812dc21b26c2295f","benches/langid.rs":"46dc68e1ee1c998fe957035c11c373cc5d2c2993dd3058aeb36014028618a46e","benches/likely_subtags.rs":"33debb6db4eabd0166525c7c06868f86e35958c2d0d9e5e7668f28b1aff3da23","benches/parser.rs":"bc5460589125aca2ca4c4cf475fde81e7de6aa70c7bf8443996b6246b44110a3","data/cldr-misc-full/README.md":"3a9754c33ea24a832bf58b4fb0c2b19fb18cda7a3159fa2107960224a7b0e335","src/bin/generate_layout.rs":"ac330cef77f526dbfb516c0b59505b9fa3e5a52888c801e6f1280fda7cc3d9f1","src/bin/generate_likelysubtags.rs":"9b0df3a008d0f6090ee441e4c649f00f9b78c7d23434f389fe3de2288951cf72","src/errors.rs":"091525fd3d704cc4698bab82af9fff1f2e6fc793910700790ec3ef943b3eddfe","src/layout_table.rs":"a3842941e96f273673cacca6cd81aa270e992aed97fbd96877d05376bd30506c","src/lib.rs":"7b4e5eebe3cda97788157d13dc5ac00adcd888e4b2390e25970c54d820f2f371","src/likelysubtags/mod.rs":"11ca5e94ced8f31b16684b87b195fcf98079c1113eed244618731f23be0698a4","src/likelysubtags/tables.rs":"64f8b9788dd792dd9e58c9fd582f662359c7afcda61d105f39069a94bc12bb47","src/parser/errors.rs":"2dacf5bf388499c9fbecf64ef950038f123335e87b6691bcdb88d185678f38d5","src/parser/mod.rs":"30f9ff487ab7b023ec7e6cfbfe4f4ebc41ca524cef0eba96a6b77ad624c9f6b8","src/serde.rs":"2ce1fdea1217c4f72b2c8e00f333902ff496c54eef5b4534adb289375c50aef0","src/subtags/language.rs":"5cc07ee0b83ac2b4ce2462ac98391e34ef269a07aa11167bc432c9b882b5a0cc","src/subtags/mod.rs":"ba23712d7ce5e0fa896c97ddc91d7eacbf21a99d62c15f5cf19a6653876bf56b","src/subtags/region.rs":"f3455679067ed0da9103d5433586cb4809628847e923bbcf35cc2d2b25a0d35e","src/subtags/script.rs":"c5ca9a2ab6d8b3a1dc3f52a73665223f0dd30901b8e5d722dd93e58a69710f5d","src/subtags/variant.rs":"418c8d1307f5ca0c7463397b5b944a0d1c712c41b1640e56ce78c3ace4b9b339","tests/canonicalize_test.rs":"5ca005223ae159c15f8809c28c1cc950dc4d69063d9de70b885f18ef8e6cca28","tests/fixtures.rs":"d03a280b67080dac1bc333255e89d8903164688a6dfaed5adbea68efd65ef1bc","tests/language_identifier_test.rs":"eb0cd5383e0925b051672e5a38b14b87997b667bbbdf0e9d72ce3a82fdbd7964","tests/likelysubtags.rs":"c154da2ba3bc31d2f2b37fe544c8e74123fd5470dffa718bbf9f4c350cca451d"},"package":"0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5"}

242
third_party/rust/unic-langid-impl/Cargo.lock сгенерированный поставляемый
Просмотреть файл

@ -2,6 +2,15 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "aho-corasick"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "atty" name = "atty"
version = "0.2.14" version = "0.2.14"
@ -25,23 +34,11 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bstr"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [
"lazy_static",
"memchr",
"regex-automata",
"serde",
]
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.11.1" version = "3.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
[[package]] [[package]]
name = "cast" name = "cast"
@ -102,21 +99,11 @@ dependencies = [
"itertools", "itertools",
] ]
[[package]]
name = "crossbeam-channel"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
dependencies = [
"cfg-if",
"crossbeam-utils",
]
[[package]] [[package]]
name = "crossbeam-deque" name = "crossbeam-deque"
version = "0.8.2" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"crossbeam-epoch", "crossbeam-epoch",
@ -125,9 +112,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-epoch" name = "crossbeam-epoch"
version = "0.9.11" version = "0.9.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"cfg-if", "cfg-if",
@ -138,40 +125,39 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.12" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]] [[package]]
name = "csv" name = "csv"
version = "1.1.6" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe"
dependencies = [ dependencies = [
"bstr",
"csv-core", "csv-core",
"itoa 0.4.8", "itoa",
"ryu", "ryu",
"serde", "serde",
] ]
[[package]] [[package]]
name = "csv-core" name = "csv-core"
version = "0.1.10" version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
[[package]] [[package]]
name = "displaydoc" name = "displaydoc"
version = "0.2.3" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -180,9 +166,9 @@ dependencies = [
[[package]] [[package]]
name = "either" name = "either"
version = "1.8.0" version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]] [[package]]
name = "half" name = "half"
@ -210,21 +196,15 @@ dependencies = [
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "0.4.8" version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
[[package]]
name = "itoa"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.60" version = "0.3.66"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca"
dependencies = [ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
@ -237,58 +217,45 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.135" version = "0.2.150"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.17" version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
dependencies = [
"cfg-if",
]
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.5.0" version = "2.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
[[package]] [[package]]
name = "memoffset" name = "memoffset"
version = "0.6.5" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
dependencies = [ dependencies = [
"autocfg", "autocfg",
] ]
[[package]] [[package]]
name = "num-traits" name = "num-traits"
version = "0.2.15" version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
dependencies = [ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "num_cpus"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
dependencies = [
"hermit-abi",
"libc",
]
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.15.0" version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
[[package]] [[package]]
name = "oorandom" name = "oorandom"
@ -298,9 +265,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
[[package]] [[package]]
name = "plotters" name = "plotters"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45"
dependencies = [ dependencies = [
"num-traits", "num-traits",
"plotters-backend", "plotters-backend",
@ -311,87 +278,91 @@ dependencies = [
[[package]] [[package]]
name = "plotters-backend" name = "plotters-backend"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609"
[[package]] [[package]]
name = "plotters-svg" name = "plotters-svg"
version = "0.3.3" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab"
dependencies = [ dependencies = [
"plotters-backend", "plotters-backend",
] ]
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.47" version = "1.0.70"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.21" version = "1.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]] [[package]]
name = "rayon" name = "rayon"
version = "1.5.3" version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1"
dependencies = [ dependencies = [
"autocfg",
"crossbeam-deque",
"either", "either",
"rayon-core", "rayon-core",
] ]
[[package]] [[package]]
name = "rayon-core" name = "rayon-core"
version = "1.9.3" version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed"
dependencies = [ dependencies = [
"crossbeam-channel",
"crossbeam-deque", "crossbeam-deque",
"crossbeam-utils", "crossbeam-utils",
"num_cpus",
] ]
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.6.0" version = "1.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
dependencies = [ dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax", "regex-syntax",
] ]
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.1.10" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.6.27" version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.11" version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
[[package]] [[package]]
name = "same-file" name = "same-file"
@ -404,15 +375,15 @@ dependencies = [
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.1.0" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.145" version = "1.0.193"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
@ -429,9 +400,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.145" version = "1.0.193"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -440,20 +411,20 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.87" version = "1.0.108"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
dependencies = [ dependencies = [
"itoa 1.0.4", "itoa",
"ryu", "ryu",
"serde", "serde",
] ]
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.102" version = "2.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -471,9 +442,9 @@ dependencies = [
[[package]] [[package]]
name = "tinystr" name = "tinystr"
version = "0.7.0" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8aeafdfd935e4a7fe16a91ab711fa52d54df84f9c8f7ca5837a9d1d902ef4c2" checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece"
dependencies = [ dependencies = [
"displaydoc", "displaydoc",
] ]
@ -490,7 +461,7 @@ dependencies = [
[[package]] [[package]]
name = "unic-langid-impl" name = "unic-langid-impl"
version = "0.9.1" version = "0.9.5"
dependencies = [ dependencies = [
"criterion", "criterion",
"serde", "serde",
@ -500,32 +471,31 @@ dependencies = [
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.5" version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
version = "0.1.10" version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
[[package]] [[package]]
name = "walkdir" name = "walkdir"
version = "2.3.2" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee"
dependencies = [ dependencies = [
"same-file", "same-file",
"winapi",
"winapi-util", "winapi-util",
] ]
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.83" version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"wasm-bindgen-macro", "wasm-bindgen-macro",
@ -533,9 +503,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.83" version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
@ -548,9 +518,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.83" version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@ -558,9 +528,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.83" version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -571,15 +541,15 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.83" version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f"
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.60" version = "0.3.66"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@ -603,9 +573,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]] [[package]]
name = "winapi-util" name = "winapi-util"
version = "0.1.5" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
dependencies = [ dependencies = [
"winapi", "winapi",
] ]

35
third_party/rust/unic-langid-impl/Cargo.toml поставляемый
Просмотреть файл

@ -10,29 +10,42 @@
# See Cargo.toml.orig for the original contents. # See Cargo.toml.orig for the original contents.
[package] [package]
edition = "2018" edition = "2021"
name = "unic-langid-impl" name = "unic-langid-impl"
version = "0.9.1" version = "0.9.5"
authors = ["Zibi Braniecki <gandalf@mozilla.com>"] authors = ["Zibi Braniecki <gandalf@mozilla.com>"]
build = false
include = [ include = [
"src/**/*", "src/**/*",
"benches/*.rs", "benches/*.rs",
"tests/*.rs", "tests/*.rs",
"Cargo.toml", "Cargo.toml",
"LICENSE-APACHE",
"LICENSE-MIT",
"README.md", "README.md",
] ]
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "API for managing Unicode Language Identifiers" description = "API for managing Unicode Language Identifiers"
readme = "README.md" readme = "README.md"
categories = ["internationalization"] categories = ["internationalization"]
license = "MIT/Apache-2.0" license = "MIT OR Apache-2.0"
repository = "https://github.com/zbraniecki/unic-locale" repository = "https://github.com/zbraniecki/unic-locale"
[lib]
name = "unic_langid_impl"
path = "src/lib.rs"
[[bin]] [[bin]]
name = "generate_likelysubtags" name = "generate_likelysubtags"
path = "src/bin/generate_likelysubtags.rs"
required-features = ["binary"] required-features = ["binary"]
[[bin]] [[bin]]
name = "generate_layout" name = "generate_layout"
path = "src/bin/generate_layout.rs"
required-features = ["binary"] required-features = ["binary"]
[[test]] [[test]]
@ -40,20 +53,36 @@ name = "likelysubtags"
path = "tests/likelysubtags.rs" path = "tests/likelysubtags.rs"
required-features = ["likelysubtags"] required-features = ["likelysubtags"]
[[test]]
name = "canonicalize_test"
path = "tests/canonicalize_test.rs"
[[test]]
name = "fixtures"
path = "tests/fixtures.rs"
[[test]]
name = "language_identifier_test"
path = "tests/language_identifier_test.rs"
[[bench]] [[bench]]
name = "parser" name = "parser"
path = "benches/parser.rs"
harness = false harness = false
[[bench]] [[bench]]
name = "langid" name = "langid"
path = "benches/langid.rs"
harness = false harness = false
[[bench]] [[bench]]
name = "canonicalize" name = "canonicalize"
path = "benches/canonicalize.rs"
harness = false harness = false
[[bench]] [[bench]]
name = "likely_subtags" name = "likely_subtags"
path = "benches/likely_subtags.rs"
harness = false harness = false
required-features = ["likelysubtags"] required-features = ["likelysubtags"]

201
third_party/rust/unic-langid-impl/LICENSE-APACHE поставляемый Normal file
Просмотреть файл

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

23
third_party/rust/unic-langid-impl/LICENSE-MIT поставляемый Normal file
Просмотреть файл

@ -0,0 +1,23 @@
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Просмотреть файл

@ -1,6 +1,29 @@
# cldr-misc-full # cldr-misc-full
This repository provides the a portion of the JSON distribution of CLDR locale data Other CLDR data not defined elsewhere
for internationalization.
Refer to the README at https://github.com/unicode-cldr/cldr-json for complete details. This package contains all locales.
[![NPM version](https://img.shields.io/npm/v/cldr-misc-full.svg?style=flat)](https://www.npmjs.org/package/cldr-misc-full)
## General Info
This is part of the JSON distribution of [CLDR](https://cldr.unicode.org/)
locale data for internationalization
For full details, please see <https://github.com/unicode-org/cldr-json>
## Bug reports
CLDR does not use Github's issue tracking system to track bugs. If you find an error in
the data contained here, please file a new ticket at [Unicode Jira](https://unicode-org.atlassian.net/projects/CLDR/issues)
## License
Copyright © 1991-2023 Unicode, Inc.
[Terms of Use](http://www.unicode.org/copyright.html)
SPDX-License-Identifier: Unicode-DFS-2016
A copy of the license is included as [LICENSE](./LICENSE).

Просмотреть файл

@ -2,7 +2,7 @@ use serde_json::Value;
use std::collections::HashMap; use std::collections::HashMap;
use std::collections::HashSet; use std::collections::HashSet;
use std::fs; use std::fs;
use unic_langid_impl::subtags::{Language, Script}; use unic_langid_impl::subtags::Script;
use unic_langid_impl::CharacterDirection; use unic_langid_impl::CharacterDirection;
use unic_langid_impl::LanguageIdentifier; use unic_langid_impl::LanguageIdentifier;
@ -15,7 +15,7 @@ fn langid_to_direction_map(path: &str) -> HashMap<LanguageIdentifier, CharacterD
let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); let contents = fs::read_to_string(path).expect("Something went wrong reading the file");
let v: Value = serde_json::from_str(&contents).unwrap(); let v: Value = serde_json::from_str(&contents).unwrap();
let langid_key = v["main"].as_object().unwrap().keys().nth(0).unwrap(); let langid_key = v["main"].as_object().unwrap().keys().next().unwrap();
if langid_key == "root" { if langid_key == "root" {
continue; continue;
@ -28,6 +28,7 @@ fn langid_to_direction_map(path: &str) -> HashMap<LanguageIdentifier, CharacterD
{ {
"right-to-left" => CharacterDirection::RTL, "right-to-left" => CharacterDirection::RTL,
"left-to-right" => CharacterDirection::LTR, "left-to-right" => CharacterDirection::LTR,
"top-to-bottom" => CharacterDirection::TTB,
_ => unimplemented!("Encountered unknown directionality!"), _ => unimplemented!("Encountered unknown directionality!"),
}; };
result.insert(langid, character_order); result.insert(langid, character_order);
@ -35,26 +36,19 @@ fn langid_to_direction_map(path: &str) -> HashMap<LanguageIdentifier, CharacterD
result result
} }
fn check_all_variants_rtl( fn check_all_script_variants(
map: &HashMap<LanguageIdentifier, CharacterDirection>, map: &HashMap<LanguageIdentifier, CharacterDirection>,
lang: Option<Language>, exp_dir: CharacterDirection,
script: Option<Script>, script: Option<Script>,
) -> bool { ) -> bool {
for (langid, dir) in map.iter() { for (langid, dir) in map.iter() {
if let Some(reference_script) = script { if let Some(reference_script) = script {
if let Some(s) = langid.script { if let Some(s) = langid.script {
if reference_script == s && dir != &CharacterDirection::RTL { if reference_script == s && *dir != exp_dir {
return false; return false;
} }
} }
} }
if let Some(reference_lang) = lang {
if langid.language == reference_lang && dir != &CharacterDirection::RTL {
println!("{:#?}", langid);
println!("{:#?}", lang);
return false;
}
}
} }
true true
} }
@ -63,50 +57,61 @@ fn main() {
let path = "./data/cldr-misc-full/main/"; let path = "./data/cldr-misc-full/main/";
let map = langid_to_direction_map(path); let map = langid_to_direction_map(path);
let mut scripts = HashSet::new(); let mut scripts_ltr = HashSet::new();
let mut langs = HashSet::new(); let mut scripts_rtl = HashSet::new();
let mut scripts_ttb = HashSet::new();
let mut langs_rtl = HashSet::new();
for (langid, dir) in map.iter() { for (langid, dir) in map.iter() {
if dir == &CharacterDirection::LTR {
continue;
}
let script = langid.script; let script = langid.script;
let scripts = match dir {
CharacterDirection::LTR => &mut scripts_ltr,
CharacterDirection::RTL => {
langs_rtl.insert(langid.language);
&mut scripts_rtl
}
CharacterDirection::TTB => &mut scripts_ttb,
};
if let Some(script) = script { if let Some(script) = script {
if scripts.contains(&script) { if scripts.contains(&script) {
continue; continue;
} }
assert!( assert!(
check_all_variants_rtl(&map, None, Some(script)), check_all_script_variants(&map, *dir, Some(script)),
"We didn't expect a script with two directionalities!" "We didn't expect a script with two directionalities!"
); );
scripts.insert(script); scripts.insert(script);
continue; continue;
} }
let lang = langid.language;
if langs.contains(&lang) {
continue;
}
assert!(
check_all_variants_rtl(&map, Some(lang), None),
"We didn't expect a language with two directionalities!"
);
langs.insert(lang);
} }
let mut scripts: Vec<String> = scripts let mut scripts_ltr: Vec<String> = scripts_ltr
.into_iter() .into_iter()
.map(|s| { .map(|s| {
let v: u32 = s.into(); let v: u32 = s.into();
v.to_string() v.to_string()
}) })
.collect(); .collect();
scripts.sort(); scripts_ltr.sort();
let mut langs: Vec<String> = langs let mut scripts_rtl: Vec<String> = scripts_rtl
.into_iter()
.map(|s| {
let v: u32 = s.into();
v.to_string()
})
.collect();
scripts_rtl.sort();
let mut scripts_ttb: Vec<String> = scripts_ttb
.into_iter()
.map(|s| {
let v: u32 = s.into();
v.to_string()
})
.collect();
scripts_ttb.sort();
let mut langs_rtl: Vec<String> = langs_rtl
.into_iter() .into_iter()
.map(|s| { .map(|s| {
let v: Option<u64> = s.into(); let v: Option<u64> = s.into();
@ -114,17 +119,29 @@ fn main() {
v.to_string() v.to_string()
}) })
.collect(); .collect();
langs.sort(); langs_rtl.sort();
println!(
"pub const SCRIPTS_CHARACTER_DIRECTION_LTR: [u32; {}] = [{}];",
scripts_ltr.len(),
scripts_ltr.join(", ")
);
println!( println!(
"pub const SCRIPTS_CHARACTER_DIRECTION_RTL: [u32; {}] = [{}];", "pub const SCRIPTS_CHARACTER_DIRECTION_RTL: [u32; {}] = [{}];",
scripts.len(), scripts_rtl.len(),
scripts.join(", ") scripts_rtl.join(", ")
);
println!(
"pub const SCRIPTS_CHARACTER_DIRECTION_TTB: [u32; {}] = [{}];",
scripts_ttb.len(),
scripts_ttb.join(", ")
); );
println!( println!(
"pub const LANGS_CHARACTER_DIRECTION_RTL: [u64; {}] = [{}];", "pub const LANGS_CHARACTER_DIRECTION_RTL: [u64; {}] = [{}];",
langs.len(), langs_rtl.len(),
langs.join(", ") langs_rtl.join(", ")
); );
} }

Просмотреть файл

@ -1,4 +1,12 @@
pub const SCRIPTS_CHARACTER_DIRECTION_RTL: [u32; 1] = [1650553409]; pub const SCRIPTS_CHARACTER_DIRECTION_LTR: [u32; 16] = [
pub const LANGS_CHARACTER_DIRECTION_RTL: [u64; 12] = [ 1635149124, 1635349071, 1735288130, 1735288404, 1768256589, 1768513878, 1801677903, 1819441475,
24934, 25715, 25960, 26485, 27001, 29281, 29301, 29547, 29552, 6450019, 6517356, 7240301, 1853120844, 1886285128, 1936613704, 1953390920, 1953657668, 1970038100, 1970435399, 2002872403,
];
pub const SCRIPTS_CHARACTER_DIRECTION_RTL: [u32; 4] =
[1650553409, 1734897490, 1835820097, 1869572942];
pub const SCRIPTS_CHARACTER_DIRECTION_TTB: [u32; 1] = [1735290701];
pub const LANGS_CHARACTER_DIRECTION_RTL: [u64; 29] = [
24934, 24936, 24944, 25715, 25960, 26214, 26485, 27001, 28002, 29281, 29301, 29547, 29549,
29552, 30308, 31329, 31349, 6450019, 6516833, 6517356, 6776946, 6841459, 7102818, 7235426,
7240301, 7303534, 7498611, 7502195, 7828084,
]; ];

28
third_party/rust/unic-langid-impl/src/lib.rs поставляемый
Просмотреть файл

@ -14,7 +14,7 @@ use std::iter::Peekable;
use std::str::FromStr; use std::str::FromStr;
/// Enum representing available character direction orientations. /// Enum representing available character direction orientations.
#[derive(Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
pub enum CharacterDirection { pub enum CharacterDirection {
/// Right To Left /// Right To Left
/// ///
@ -24,6 +24,10 @@ pub enum CharacterDirection {
/// ///
/// Used in languages such as French, Spanish, English, German etc. /// Used in languages such as French, Spanish, English, German etc.
LTR, LTR,
/// Top To Bottom
///
/// Used in Traditional Mongolian
TTB,
} }
type PartsTuple = ( type PartsTuple = (
@ -242,7 +246,7 @@ impl LanguageIdentifier {
) -> bool { ) -> bool {
let other = other.as_ref(); let other = other.as_ref();
self.language self.language
.matches(&other.language, self_as_range, other_as_range) .matches(other.language, self_as_range, other_as_range)
&& subtag_matches(&self.script, &other.script, self_as_range, other_as_range) && subtag_matches(&self.script, &other.script, self_as_range, other_as_range)
&& subtag_matches(&self.region, &other.region, self_as_range, other_as_range) && subtag_matches(&self.region, &other.region, self_as_range, other_as_range)
&& subtags_match( && subtags_match(
@ -272,7 +276,7 @@ impl LanguageIdentifier {
/// ``` /// ```
pub fn variants(&self) -> impl ExactSizeIterator<Item = &subtags::Variant> { pub fn variants(&self) -> impl ExactSizeIterator<Item = &subtags::Variant> {
let variants: &[_] = match self.variants { let variants: &[_] = match self.variants {
Some(ref v) => &**v, Some(ref v) => v,
None => &[], None => &[],
}; };
@ -413,12 +417,30 @@ impl LanguageIdentifier {
/// ``` /// ```
pub fn character_direction(&self) -> CharacterDirection { pub fn character_direction(&self) -> CharacterDirection {
match (self.language.into(), self.script) { match (self.language.into(), self.script) {
(_, Some(script))
if layout_table::SCRIPTS_CHARACTER_DIRECTION_LTR.contains(&script.into()) =>
{
CharacterDirection::LTR
}
(_, Some(script)) (_, Some(script))
if layout_table::SCRIPTS_CHARACTER_DIRECTION_RTL.contains(&script.into()) => if layout_table::SCRIPTS_CHARACTER_DIRECTION_RTL.contains(&script.into()) =>
{ {
CharacterDirection::RTL CharacterDirection::RTL
} }
(_, Some(script))
if layout_table::SCRIPTS_CHARACTER_DIRECTION_TTB.contains(&script.into()) =>
{
CharacterDirection::TTB
}
(Some(lang), _) if layout_table::LANGS_CHARACTER_DIRECTION_RTL.contains(&lang) => { (Some(lang), _) if layout_table::LANGS_CHARACTER_DIRECTION_RTL.contains(&lang) => {
#[cfg(feature = "likelysubtags")]
if let Some((_, Some(script), _)) =
likelysubtags::maximize(self.language, None, self.region)
{
if layout_table::SCRIPTS_CHARACTER_DIRECTION_LTR.contains(&script.into()) {
return CharacterDirection::LTR;
}
}
CharacterDirection::RTL CharacterDirection::RTL
} }
_ => CharacterDirection::LTR, _ => CharacterDirection::LTR,

Просмотреть файл

@ -38,7 +38,7 @@ pub fn maximize(
if let Some(l) = Into::<Option<u64>>::into(lang) { if let Some(l) = Into::<Option<u64>>::into(lang) {
if let Some(r) = region { if let Some(r) = region {
let result = tables::LANG_REGION let result = tables::LANG_REGION
.binary_search_by_key(&(&l.into(), &r.into()), |(key_l, key_r, _)| (key_l, key_r)) .binary_search_by_key(&(&l, &r.into()), |(key_l, key_r, _)| (key_l, key_r))
.ok(); .ok();
if let Some(r) = result { if let Some(r) = result {
// safe because all table entries are well formed. // safe because all table entries are well formed.
@ -48,7 +48,7 @@ pub fn maximize(
if let Some(s) = script { if let Some(s) = script {
let result = tables::LANG_SCRIPT let result = tables::LANG_SCRIPT
.binary_search_by_key(&(&l.into(), &s.into()), |(key_l, key_s, _)| (key_l, key_s)) .binary_search_by_key(&(&l, &s.into()), |(key_l, key_s, _)| (key_l, key_s))
.ok(); .ok();
if let Some(r) = result { if let Some(r) = result {
// safe because all table entries are well formed. // safe because all table entries are well formed.
@ -57,7 +57,7 @@ pub fn maximize(
} }
let result = tables::LANG_ONLY let result = tables::LANG_ONLY
.binary_search_by_key(&(&l.into()), |(key_l, _)| key_l) .binary_search_by_key(&(&l), |(key_l, _)| key_l)
.ok(); .ok();
if let Some(r) = result { if let Some(r) = result {
// safe because all table entries are well formed. // safe because all table entries are well formed.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -12,7 +12,7 @@ impl Language {
let slen = v.len(); let slen = v.len();
let s = TinyStr8::from_bytes(v).map_err(|_| ParserError::InvalidLanguage)?; let s = TinyStr8::from_bytes(v).map_err(|_| ParserError::InvalidLanguage)?;
if slen < 2 || slen > 8 || slen == 4 || !s.is_ascii_alphabetic() { if !(2..=8).contains(&slen) || slen == 4 || !s.is_ascii_alphabetic() {
return Err(ParserError::InvalidLanguage); return Err(ParserError::InvalidLanguage);
} }

Просмотреть файл

@ -9,7 +9,7 @@ impl Variant {
pub fn from_bytes(v: &[u8]) -> Result<Self, ParserError> { pub fn from_bytes(v: &[u8]) -> Result<Self, ParserError> {
let slen = v.len(); let slen = v.len();
if slen < 4 || slen > 8 { if !(4..=8).contains(&slen) {
return Err(ParserError::InvalidSubtag); return Err(ParserError::InvalidSubtag);
} }

Просмотреть файл

@ -146,10 +146,43 @@ fn test_matches_as_range() {
#[test] #[test]
fn test_character_direction() { fn test_character_direction() {
let langid: LanguageIdentifier = "en-US".parse().unwrap(); let en_us: LanguageIdentifier = "en-US".parse().unwrap();
let langid2: LanguageIdentifier = "ar-AF".parse().unwrap(); assert_eq!(en_us.character_direction(), CharacterDirection::LTR);
assert_eq!(langid.character_direction(), CharacterDirection::LTR);
assert_eq!(langid2.character_direction(), CharacterDirection::RTL); let ar_af: LanguageIdentifier = "ar-AF".parse().unwrap();
assert_eq!(ar_af.character_direction(), CharacterDirection::RTL);
let ks: LanguageIdentifier = "ks".parse().unwrap();
assert_eq!(ks.character_direction(), CharacterDirection::RTL);
let ks_deva: LanguageIdentifier = "ks-Deva".parse().unwrap();
assert_eq!(ks_deva.character_direction(), CharacterDirection::LTR);
let mn_mong: LanguageIdentifier = "mn-Mong".parse().unwrap();
assert_eq!(mn_mong.character_direction(), CharacterDirection::TTB);
let lid: LanguageIdentifier = "pa-Guru".parse().unwrap();
assert_eq!(lid.character_direction(), CharacterDirection::LTR);
let lid_pa_pk: LanguageIdentifier = "pa-PK".parse().unwrap();
assert_eq!(lid_pa_pk.character_direction(), CharacterDirection::RTL);
let lid_ar_us: LanguageIdentifier = "ar-US".parse().unwrap();
assert_eq!(lid_ar_us.character_direction(), CharacterDirection::RTL);
}
#[cfg(not(feature = "likelysubtags"))]
#[test]
fn test_character_direction_without_likelysubtags() {
let lid: LanguageIdentifier = "pa".parse().unwrap();
assert_eq!(lid.character_direction(), CharacterDirection::RTL);
}
#[cfg(feature = "likelysubtags")]
#[test]
fn test_character_direction_with_likelysubtags() {
let lid_pa: LanguageIdentifier = "pa".parse().unwrap();
assert_eq!(lid_pa.character_direction(), CharacterDirection::LTR);
} }
#[test] #[test]

Просмотреть файл

@ -32,10 +32,10 @@ static STRINGS: &[(&str, Option<&str>)] = &[
("en-Latn-DE", None), ("en-Latn-DE", None),
("pl-FR", Some("pl-Latn-FR")), ("pl-FR", Some("pl-Latn-FR")),
("de-CH", Some("de-Latn-CH")), ("de-CH", Some("de-Latn-CH")),
("tuq", Some("tuq-Latn")), ("tuq", Some("tuq-Latn-TD")),
("sr-ME", Some("sr-Latn-ME")), ("sr-ME", Some("sr-Latn-ME")),
("ng", Some("ng-Latn-NA")), ("ng", Some("ng-Latn-NA")),
("klx", Some("klx-Latn")), ("klx", Some("klx-Latn-PG")),
("kk-Arab", Some("kk-Arab-CN")), ("kk-Arab", Some("kk-Arab-CN")),
("en-Cyrl", Some("en-Cyrl-US")), ("en-Cyrl", Some("en-Cyrl-US")),
("und-Cyrl-UK", Some("ru-Cyrl-UK")), ("und-Cyrl-UK", Some("ru-Cyrl-UK")),
@ -95,7 +95,7 @@ fn maximize_test() {
#[test] #[test]
fn version_works() { fn version_works() {
assert_eq!(CLDR_VERSION, "36"); assert_eq!(CLDR_VERSION, "44");
} }
#[test] #[test]

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"22c66abe20079b152feec2c6e54c2026fcfe5b896fb20f7b45b1f5d11690aecd","README.md":"f68b87b732b8a0d7fe6bc3b4ff5989207e87bd51f98220136ced4cd65f814f7c","src/lib.rs":"af8a91215b975e94cfff7282d948ed74236c1cb10ad047df583ea1b01e2fe4cd"},"package":"398f9ad7239db44fd0f80fe068d12ff22d78354080332a5077dc6f52f14dcf2f"} {"files":{"Cargo.toml":"2800ea65d78a3e539be27ec552feb35446391319585d7770af911d998884fdc9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f68b87b732b8a0d7fe6bc3b4ff5989207e87bd51f98220136ced4cd65f814f7c","src/lib.rs":"af8a91215b975e94cfff7282d948ed74236c1cb10ad047df583ea1b01e2fe4cd","tests/langid.rs":"0814412a7968a53123c6220f892b4d7e0a7859057dc69cb92cd1cdad343dada8"},"package":"23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44"}

28
third_party/rust/unic-langid/Cargo.toml поставляемый
Просмотреть файл

@ -10,31 +10,47 @@
# See Cargo.toml.orig for the original contents. # See Cargo.toml.orig for the original contents.
[package] [package]
edition = "2018" edition = "2021"
name = "unic-langid" name = "unic-langid"
version = "0.9.1" version = "0.9.5"
authors = ["Zibi Braniecki <gandalf@mozilla.com>"] authors = ["Zibi Braniecki <gandalf@mozilla.com>"]
build = false
include = [ include = [
"src/**/*", "src/**/*",
"benches/*.rs", "benches/*.rs",
"tests/*.rs",
"Cargo.toml", "Cargo.toml",
"LICENSE-APACHE",
"LICENSE-MIT",
"README.md", "README.md",
] ]
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "API for managing Unicode Language Identifiers" description = "API for managing Unicode Language Identifiers"
readme = "README.md" readme = "README.md"
categories = ["internationalization"] categories = ["internationalization"]
license = "MIT/Apache-2.0" license = "MIT OR Apache-2.0"
repository = "https://github.com/zbraniecki/unic-locale" repository = "https://github.com/zbraniecki/unic-locale"
[lib]
name = "unic_langid"
path = "src/lib.rs"
[[test]]
name = "langid"
path = "tests/langid.rs"
[dependencies.unic-langid-impl] [dependencies.unic-langid-impl]
version = "0.9" version = "0.9.5"
[dependencies.unic-langid-macros] [dependencies.unic-langid-macros]
version = "0.9" version = "0.9.5"
optional = true optional = true
[dev-dependencies.unic-langid-macros] [dev-dependencies.unic-langid-macros]
version = "0.9" version = "0.9.5"
[features] [features]
default = [] default = []

201
third_party/rust/unic-langid/LICENSE-APACHE поставляемый Normal file
Просмотреть файл

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

23
third_party/rust/unic-langid/LICENSE-MIT поставляемый Normal file
Просмотреть файл

@ -0,0 +1,23 @@
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

72
third_party/rust/unic-langid/tests/langid.rs поставляемый Normal file
Просмотреть файл

@ -0,0 +1,72 @@
use unic_langid::LanguageIdentifier;
#[cfg(feature = "unic-langid-macros")]
use unic_langid::{langid, langid_slice, langids};
#[test]
fn basic_test() {
let loc: LanguageIdentifier = "en-US".parse().expect("Malformed Language Identifier");
assert_eq!(&loc.to_string(), "en-US");
}
#[test]
#[cfg(feature = "unic-langid-macros")]
fn langid_macro_test() {
let loc = langid!("en-US");
assert_eq!(&loc.to_string(), "en-US");
// ensure it can be used in a const context
const _: LanguageIdentifier = langid!("en-US");
}
#[test]
#[cfg(feature = "unic-langid-macros")]
fn langids_macro_test() {
let langids = langids!["en-US", "pl", "de-AT", "Pl-Latn-PL"];
assert_eq!(langids.len(), 4);
assert_eq!(langids.get(3).unwrap().language.as_str(), "pl");
// check trailing comma
langids!["en-US", "pl",];
}
#[test]
#[cfg(feature = "unic-langid-macros")]
fn langid_slice_macro_test() {
let langids = langids!["en-US", "pl", "de-AT", "Pl-Latn-PL"];
// ensure it can be used in a const context
const CONST_LANGIDS: &[LanguageIdentifier] =
langid_slice!["en-US", "pl", "de-AT", "Pl-Latn-PL"];
assert_eq!(CONST_LANGIDS, langids.as_slice());
// check trailing comma
let _ = langid_slice!["en-US", "pl",];
}
#[test]
fn langid_ord() {
let mut input = vec!["en-Latn", "en-US"];
let mut langids: Vec<LanguageIdentifier> = input.iter().map(|l| l.parse().unwrap()).collect();
assert_eq!(
langids
.iter()
.map(|l: &LanguageIdentifier| l.to_string())
.collect::<Vec<_>>(),
&["en-Latn", "en-US"]
);
input.sort();
assert_eq!(input, &["en-Latn", "en-US"]);
langids.sort();
assert_eq!(
langids
.iter()
.map(|l: &LanguageIdentifier| l.to_string())
.collect::<Vec<_>>(),
&["en-US", "en-Latn"]
);
}