Bug 1969403 - Vendor application-services 663690e for Suggest geonames and weather changes. r=bdk a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D251802
This commit is contained in:
Drew Willcoxon
2025-05-30 16:35:09 +00:00
committed by rvandermeulen@mozilla.com
parent eca440806a
commit 74859c0b57
8 changed files with 1623 additions and 1028 deletions

View File

@@ -70,9 +70,9 @@ git = "https://github.com/jfkthame/mapped_hyph.git"
rev = "eff105f6ad7ec9b79816cfc1985a28e5340ad14b"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424"]
[source."git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6"]
git = "https://github.com/mozilla/application-services"
rev = "8986582d377eac7b64bddec8aa9c5ce06b161424"
rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/audioipc?rev=e6f44a2bd1e57d11dfc737632a9e849077632330"]

34
Cargo.lock generated
View File

@@ -973,7 +973,7 @@ dependencies = [
[[package]]
name = "context_id"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"chrono",
"error-support",
@@ -1912,7 +1912,7 @@ dependencies = [
[[package]]
name = "error-support"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"env_logger",
"error-support-macros",
@@ -1925,7 +1925,7 @@ dependencies = [
[[package]]
name = "error-support-macros"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"proc-macro2",
"quote",
@@ -2044,7 +2044,7 @@ dependencies = [
[[package]]
name = "firefox-versioning"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"serde_json",
"thiserror 1.999.999",
@@ -3385,7 +3385,7 @@ dependencies = [
[[package]]
name = "interrupt-support"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"lazy_static",
"parking_lot",
@@ -5108,7 +5108,7 @@ checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
[[package]]
name = "payload-support"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"serde",
"serde_derive",
@@ -5615,7 +5615,7 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
[[package]]
name = "relevancy"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"anyhow",
"base64 0.21.999",
@@ -5639,7 +5639,7 @@ dependencies = [
[[package]]
name = "remote_settings"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"anyhow",
"camino",
@@ -5931,7 +5931,7 @@ dependencies = [
[[package]]
name = "search"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"error-support",
"firefox-versioning",
@@ -6223,7 +6223,7 @@ dependencies = [
[[package]]
name = "sql-support"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"error-support",
"interrupt-support",
@@ -6422,7 +6422,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
name = "suggest"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"anyhow",
"chrono",
@@ -6475,7 +6475,7 @@ dependencies = [
[[package]]
name = "sync-guid"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"base64 0.21.999",
"rand",
@@ -6486,7 +6486,7 @@ dependencies = [
[[package]]
name = "sync15"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"anyhow",
"error-support",
@@ -6525,7 +6525,7 @@ dependencies = [
[[package]]
name = "tabs"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"anyhow",
"error-support",
@@ -6883,7 +6883,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
[[package]]
name = "types"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"rusqlite 0.33.0",
"serde",
@@ -7295,7 +7295,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "viaduct"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"error-support",
"ffi-support",
@@ -7464,7 +7464,7 @@ dependencies = [
[[package]]
name = "webext-storage"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=8986582d377eac7b64bddec8aa9c5ce06b161424#8986582d377eac7b64bddec8aa9c5ce06b161424"
source = "git+https://github.com/mozilla/application-services?rev=663690e16ee2f39a46ac7fc22d9017784ca7d4e6#663690e16ee2f39a46ac7fc22d9017784ca7d4e6"
dependencies = [
"anyhow",
"error-support",

View File

@@ -262,15 +262,15 @@ wr_malloc_size_of = { path = "gfx/wr/wr_malloc_size_of" }
objc = { git = "https://github.com/glandium/rust-objc", rev = "4de89f5aa9851ceca4d40e7ac1e2759410c04324" }
# application-services overrides to make updating them all simpler.
context_id = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
relevancy = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
search = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
sql-support = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
suggest = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
sync15 = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
tabs = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
viaduct = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "8986582d377eac7b64bddec8aa9c5ce06b161424" }
context_id = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
relevancy = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
search = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
sql-support = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
suggest = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
sync15 = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
tabs = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
viaduct = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "663690e16ee2f39a46ac7fc22d9017784ca7d4e6" }
allocator-api2 = { path = "third_party/rust/allocator-api2" }

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"c4a478ab37cdb8bea8392dfbe9fbc2e1a534259c7be22b864b8aad86381d8718","README.md":"478bd3dcd41863df0975c96fd38e34334d8146799bf1a16204bab2cc12dcffd2","src/callback.rs":"13305f4665e62abb4de08d9486295a60afd327b6c839d7ef314312d96dc098dc","src/error.rs":"969ba252410f2adff0ff91ec7eeaf52ffb9e91925eb9db0529f56c09872f78f8","src/lib.rs":"8bd9e98e0e194cea4b2fdd0393709113785db63ccdbc0e9518fa55c21f8bb13d","src/mars.rs":"4909fc4f8b397d32144878d6ec64c414b7d724ed2532513f165c768cfe5b983f"},"package":null}
{"files":{"Cargo.toml":"c4a478ab37cdb8bea8392dfbe9fbc2e1a534259c7be22b864b8aad86381d8718","README.md":"478bd3dcd41863df0975c96fd38e34334d8146799bf1a16204bab2cc12dcffd2","src/callback.rs":"13305f4665e62abb4de08d9486295a60afd327b6c839d7ef314312d96dc098dc","src/error.rs":"969ba252410f2adff0ff91ec7eeaf52ffb9e91925eb9db0529f56c09872f78f8","src/lib.rs":"8bd9e98e0e194cea4b2fdd0393709113785db63ccdbc0e9518fa55c21f8bb13d","src/mars.rs":"4909fc4f8b397d32144878d6ec64c414b7d724ed2532513f165c768cfe5b983f","uniffi.toml":"02d52578b859174a22728da6d6b546d94faa435866e94ac035f975d4a2ac6f5a"},"package":null}

View File

@@ -0,0 +1,3 @@
[bindings.swift]
ffi_module_name = "MozillaRustComponents"
ffi_module_filename = "contextIDFFI"

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"57d202b48263d0ea4070807c66f26260497fb947f2099b7275a3e28463ad28ca","README.md":"5e28baf874b643d756228bdab345e287bf107d3182dfe6a18aafadcc4b9a3fc9","benches/benchmark_all.rs":"5909dfb1e62793afb1f2bc15b75914527a4d14fce6796307c04a309e45c0598c","metrics.yaml":"0540ab2271aeab7f07335c7ceec12acde942995f9dcb3c29070489aa61899d56","src/benchmarks/README.md":"ccee8dbddba8762d0453fa855bd6984137b224b8c019f3dd8e86a3c303f51d71","src/benchmarks/client.rs":"e5897d4e2eda06809fa6dc6db4e780b9ef266f613fb113aa6613b83f7005dd0b","src/benchmarks/geoname.rs":"fb4e8eb48e27879fe3f35d6d2415f0237b087b51b89ee03fb50fa635e1c1a3b5","src/benchmarks/ingest.rs":"1f3b5eca704c51bc8f972e7a3492a518516461e5834f97a5f7d1855a048ab16b","src/benchmarks/mod.rs":"2c9a39b7a5144674d2475f4d7d69d77c4545f9aa5f123968cb32574e76f10b1a","src/benchmarks/query.rs":"d54946063e72cf98e7f46d94665c17c66af637774c2bb50cd5798dbe63d74f3c","src/bin/debug_ingestion_sizes.rs":"ce6e810be7b3fc19e826d75b622b82cfab5a1a99397a6d0833c2c4eebff2d364","src/config.rs":"0ca876e845841bb6429862c0904c82265003f53b55aea053fac60aed278586a7","src/db.rs":"dbb2923192d062ee6f20e780ce5544afc999b01ab3eea81b46abe9e412750c4d","src/error.rs":"e2ef3ec0e0b2b8ecbb8f2f1717d4cb753af06913b8395d086b7643098ad100a7","src/fakespot.rs":"f501c9fe5296e7c130a9fcb532b861465717652cb5ef688230bc7a3b94df91b1","src/geoname.rs":"24d4e37f67ece92e5d268ecca22bdeef65a674db282530f248c1011c5ca77449","src/lib.rs":"3b8ccb1e93d214d27b7ef77326da40a0b85621f32ba143664f55e4fb2a665e7c","src/metrics.rs":"871f0d834efbbc9e26d61f66fa31f0021dcf41444746cd7c082f93ba9628e399","src/pocket.rs":"1316668840ec9b4ea886223921dc9d3b5a1731d1a5206c0b1089f2a6c45c1b7b","src/provider.rs":"6ec6b207eca1f4f9553fcb2d57d3a05d87279e81e09def5abdc5219ce838a4e9","src/query.rs":"66f229272c9245eb8ee0cab237071627aec599f145f64da8894bcaeb1ed7c6f9","src/rs.rs":"42b5a81c33df7dbabae5cb9756b7d947553545ae76e3dbd5eb3dcced3a31ce68","src/schema.rs":"a925dd09c609c2bc2338242a3f057e884e9add6478b15180f61bb53adda6574d","src/store.rs":"66d7f31b9d8713b11ecf389728beda3d9c5b0ea8402141b7ddf198372a1111f4","src/suggestion.rs":"6e902501624b62d9bde1c771eded87e7620540c691667d0ac913d8c21c183e9a","src/testing/client.rs":"47a32fd84c733001f11e8bfff94dc8c060b6b0780346dca5ddc7a5f5489c1d85","src/testing/data.rs":"ad710b31532a9540491a73cba33a54db02e85dd5ec0a4f2260430f144c3d7380","src/testing/mod.rs":"bd02746cdc6e2d54a7691b3ffbccb1a81b66b717871c34dd1a8b6088dc125185","src/util.rs":"52c6ec405637afa2d1a89f29fbbb7dcc341546b6deb97d326c4490bbf8713cb0","src/weather.rs":"c3ab5e8a4e3dd7be0a4bb37848db0b6295050d151ade9c935a7fb4c7e12a1367","src/yelp.rs":"1fe3b7eb6b3f7462e9758b6eb62457dfa26f7549a8290cdff7637d2fb3ffea4f","uniffi.toml":"8205e4679ac26d53e70af0f85c013fd27cda1119f4322aebf5f2b9403d45a611"},"package":null}
{"files":{"Cargo.toml":"57d202b48263d0ea4070807c66f26260497fb947f2099b7275a3e28463ad28ca","README.md":"5e28baf874b643d756228bdab345e287bf107d3182dfe6a18aafadcc4b9a3fc9","benches/benchmark_all.rs":"5909dfb1e62793afb1f2bc15b75914527a4d14fce6796307c04a309e45c0598c","metrics.yaml":"0540ab2271aeab7f07335c7ceec12acde942995f9dcb3c29070489aa61899d56","src/benchmarks/README.md":"ccee8dbddba8762d0453fa855bd6984137b224b8c019f3dd8e86a3c303f51d71","src/benchmarks/client.rs":"e5897d4e2eda06809fa6dc6db4e780b9ef266f613fb113aa6613b83f7005dd0b","src/benchmarks/geoname.rs":"fb4e8eb48e27879fe3f35d6d2415f0237b087b51b89ee03fb50fa635e1c1a3b5","src/benchmarks/ingest.rs":"1f3b5eca704c51bc8f972e7a3492a518516461e5834f97a5f7d1855a048ab16b","src/benchmarks/mod.rs":"2c9a39b7a5144674d2475f4d7d69d77c4545f9aa5f123968cb32574e76f10b1a","src/benchmarks/query.rs":"d54946063e72cf98e7f46d94665c17c66af637774c2bb50cd5798dbe63d74f3c","src/bin/debug_ingestion_sizes.rs":"ce6e810be7b3fc19e826d75b622b82cfab5a1a99397a6d0833c2c4eebff2d364","src/config.rs":"0ca876e845841bb6429862c0904c82265003f53b55aea053fac60aed278586a7","src/db.rs":"dbb2923192d062ee6f20e780ce5544afc999b01ab3eea81b46abe9e412750c4d","src/error.rs":"e2ef3ec0e0b2b8ecbb8f2f1717d4cb753af06913b8395d086b7643098ad100a7","src/fakespot.rs":"f501c9fe5296e7c130a9fcb532b861465717652cb5ef688230bc7a3b94df91b1","src/geoname.rs":"deee7041db3cb3d7d989146d28149fbd1b68c7428dea41c0b026e37e2c66a61d","src/lib.rs":"3b8ccb1e93d214d27b7ef77326da40a0b85621f32ba143664f55e4fb2a665e7c","src/metrics.rs":"871f0d834efbbc9e26d61f66fa31f0021dcf41444746cd7c082f93ba9628e399","src/pocket.rs":"1316668840ec9b4ea886223921dc9d3b5a1731d1a5206c0b1089f2a6c45c1b7b","src/provider.rs":"6ec6b207eca1f4f9553fcb2d57d3a05d87279e81e09def5abdc5219ce838a4e9","src/query.rs":"66f229272c9245eb8ee0cab237071627aec599f145f64da8894bcaeb1ed7c6f9","src/rs.rs":"42b5a81c33df7dbabae5cb9756b7d947553545ae76e3dbd5eb3dcced3a31ce68","src/schema.rs":"a925dd09c609c2bc2338242a3f057e884e9add6478b15180f61bb53adda6574d","src/store.rs":"66d7f31b9d8713b11ecf389728beda3d9c5b0ea8402141b7ddf198372a1111f4","src/suggestion.rs":"6e902501624b62d9bde1c771eded87e7620540c691667d0ac913d8c21c183e9a","src/testing/client.rs":"47a32fd84c733001f11e8bfff94dc8c060b6b0780346dca5ddc7a5f5489c1d85","src/testing/data.rs":"ad710b31532a9540491a73cba33a54db02e85dd5ec0a4f2260430f144c3d7380","src/testing/mod.rs":"bd02746cdc6e2d54a7691b3ffbccb1a81b66b717871c34dd1a8b6088dc125185","src/util.rs":"52c6ec405637afa2d1a89f29fbbb7dcc341546b6deb97d326c4490bbf8713cb0","src/weather.rs":"fd31f9787cf91b15c902271b0bd0a5fb180b90bb465d4002bc1e91bd1fb161b6","src/yelp.rs":"1fe3b7eb6b3f7462e9758b6eb62457dfa26f7549a8290cdff7637d2fb3ffea4f","uniffi.toml":"8205e4679ac26d53e70af0f85c013fd27cda1119f4322aebf5f2b9403d45a611"},"package":null}

View File

@@ -195,6 +195,10 @@ impl GeonameMatchType {
matches!(self, GeonameMatchType::Abbreviation)
}
pub fn is_airport_code(&self) -> bool {
matches!(self, GeonameMatchType::AirportCode)
}
pub fn is_name(&self) -> bool {
matches!(self, GeonameMatchType::Name)
}
@@ -977,6 +981,76 @@ pub(crate) mod tests {
"longitude": "-99.25061",
},
// New Orleans (shares a prefix with New York)
{
"id": 4335045,
"name": "New Orleans",
"feature_class": "P",
"feature_code": "PPLA2",
"country": "US",
"admin1": "LA",
"admin2": "071",
"admin3": "98000",
"population": 389617,
"latitude": "29.95465",
"longitude": "-90.07507",
},
// Carlsbad, CA (in San Diego county, name starts with "CA")
{
"id": 5334223,
"name": "Carlsbad",
"country": "US",
"feature_class": "P",
"feature_code": "PPL",
"admin1": "CA",
"admin2": "073",
"population": 114746,
"latitude": "33.15809",
"longitude": "-117.35059",
},
// San Diego
{
"id": 5391811,
"name": "San Diego",
"country": "US",
"feature_class": "P",
"feature_code": "PPLA2",
"admin1": "CA",
"admin2": "073",
"population": 1394928,
"latitude": "32.71571",
"longitude": "-117.16472",
},
// San Diego County (same name as the city)
{
"id": 5391832,
"name": "San Diego",
"country": "US",
"feature_class": "A",
"feature_code": "ADM2",
"admin1": "CA",
"admin2": "073",
"population": 3095313,
"latitude": "33.0282",
"longitude": "-116.77021",
},
// CA
{
"id": 5332921,
"name": "California",
"feature_class": "A",
"feature_code": "ADM1",
"country": "US",
"admin1": "CA",
"population": 39512223,
"latitude": "37.25022",
"longitude": "-119.75126",
},
// Made-up city with a long name (the digits in the name are to
// prevent matches on this geoname in weather tests, etc.)
{
@@ -1305,6 +1379,8 @@ pub(crate) mod tests {
"NYC",
"NY",
]],
// CA
[5332921, ["CA"]],
// United States
[6252001, [
{ "name": "US", "is_short": true },
@@ -1419,6 +1495,56 @@ pub(crate) mod tests {
}
}
pub(crate) fn new_orleans() -> Geoname {
Geoname {
geoname_id: 4335045,
geoname_type: GeonameType::City,
name: "New Orleans".to_string(),
feature_class: "P".to_string(),
feature_code: "PPLA2".to_string(),
country_code: "US".to_string(),
admin_division_codes: [
(1, "LA".to_string()),
(2, "071".to_string()),
(3, "98000".to_string()),
]
.into(),
population: 389617,
latitude: "29.95465".to_string(),
longitude: "-90.07507".to_string(),
}
}
pub(crate) fn carlsbad() -> Geoname {
Geoname {
geoname_id: 5334223,
geoname_type: GeonameType::City,
name: "Carlsbad".to_string(),
feature_class: "P".to_string(),
feature_code: "PPL".to_string(),
country_code: "US".to_string(),
admin_division_codes: [(1, "CA".to_string()), (2, "073".to_string())].into(),
population: 114746,
latitude: "33.15809".to_string(),
longitude: "-117.35059".to_string(),
}
}
pub(crate) fn san_diego() -> Geoname {
Geoname {
geoname_id: 5391811,
geoname_type: GeonameType::City,
name: "San Diego".to_string(),
feature_class: "P".to_string(),
feature_code: "PPLA2".to_string(),
country_code: "US".to_string(),
admin_division_codes: [(1, "CA".to_string()), (2, "073".to_string())].into(),
population: 1394928,
latitude: "32.71571".to_string(),
longitude: "-117.16472".to_string(),
}
}
pub(crate) fn long_name_city() -> Geoname {
Geoname {
geoname_id: 999,
@@ -2408,6 +2534,11 @@ pub(crate) mod tests {
match_type: GeonameMatchType::Name,
prefix: true,
},
GeonameMatch {
geoname: new_orleans(),
match_type: GeonameMatchType::Name,
prefix: true,
},
GeonameMatch {
geoname: ny_state(),
match_type: GeonameMatchType::Name,

File diff suppressed because it is too large Load Diff