diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
commit | a0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch) | |
tree | fc451898ccaf445814e26b46664d78702178101d /vendor/handlebars | |
parent | Adding debian version 1.71.1+dfsg1-2. (diff) | |
download | rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/handlebars')
-rw-r--r-- | vendor/handlebars/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/handlebars/CHANGELOG.md | 23 | ||||
-rw-r--r-- | vendor/handlebars/Cargo.lock | 582 | ||||
-rw-r--r-- | vendor/handlebars/Cargo.toml | 3 | ||||
-rw-r--r-- | vendor/handlebars/README.md | 1 | ||||
-rw-r--r-- | vendor/handlebars/examples/decorator.rs | 6 | ||||
-rw-r--r-- | vendor/handlebars/examples/render.rs | 3 | ||||
-rw-r--r-- | vendor/handlebars/examples/render_file.rs | 3 | ||||
-rw-r--r-- | vendor/handlebars/release.toml | 1 | ||||
-rw-r--r-- | vendor/handlebars/src/decorators/mod.rs | 12 | ||||
-rw-r--r-- | vendor/handlebars/src/error.rs | 15 | ||||
-rw-r--r-- | vendor/handlebars/src/helpers/mod.rs | 16 | ||||
-rw-r--r-- | vendor/handlebars/src/lib.rs | 4 | ||||
-rw-r--r-- | vendor/handlebars/src/macros.rs | 2 | ||||
-rw-r--r-- | vendor/handlebars/src/output.rs | 21 | ||||
-rw-r--r-- | vendor/handlebars/src/partial.rs | 67 | ||||
-rw-r--r-- | vendor/handlebars/src/registry.rs | 48 | ||||
-rw-r--r-- | vendor/handlebars/src/render.rs | 598 | ||||
-rw-r--r-- | vendor/handlebars/src/template.rs | 50 | ||||
-rw-r--r-- | vendor/handlebars/tests/escape.rs | 25 | ||||
-rw-r--r-- | vendor/handlebars/tests/helper_macro.rs | 20 |
21 files changed, 788 insertions, 714 deletions
diff --git a/vendor/handlebars/.cargo-checksum.json b/vendor/handlebars/.cargo-checksum.json index b1031c230..9b1aa7a0e 100644 --- a/vendor/handlebars/.cargo-checksum.json +++ b/vendor/handlebars/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"1c33d57ecdf48bcc7011c1e7306d05359a3fca61f3c48324e5cb5b378d406ef6","Cargo.lock":"81ba21eaf5647124881eacf240b9c34ae15c4f3b56072d7ff3ec665f269c3843","Cargo.toml":"afbdf3fe79ae8e5a434f6cb126f3441e8750a499f2b159226cd86e48e4d5424e","LICENSE":"63b308fad3db82dc12067a8d7ff4b672fae97d12d0b4b3bb59179e27d640b3a4","README.md":"ae8924a77607ab2439ef2cb87a93c49b51a4da228ea144bc847ec6d2a4acffba","benches/bench.rs":"276ac8c581db35dbdc00e9e4cc1e2e1940fe95522a8f5a19ab088a2c68da61ed","build-wasm.sh":"9f7226d7d0768fe0fba97f698642a4c13a600468ba7d57abcfad9285efd9f4ce","examples/decorator.rs":"010762d337c64a8ade120c66ccb97ac176653d2fc1265c6f77c35d2a7693176f","examples/decorator/template.hbs":"76fd24f08b28b469529f4727321c7cc940198abb5c1aa24d7a6dd2ab42bdda66","examples/dev_mode.rs":"7c8cebbc56da3e834688719f5c10df1c372c059259e40df8534c79a0dda01aab","examples/dev_mode/template.hbs":"4a5e1b81565572e26986d890e4a431953b81893a99ce07cef303e366dd84243c","examples/error.rs":"6f3d4dc945628778d3ef63dccdc7abbf367e214a5ff62a5dcbeb11d8f34317d7","examples/error/error.hbs":"4e8fac806d444a5bc41436fe0a51b4d7850c7645f8996db7a99a821c88622eef","examples/error/template.hbs":"48313b522ddb0dd4285874b96d1b705b841dc141514f440790e904a262955951","examples/helper_macro.rs":"ca0c7b7a45e8f3f8c7fe25d59a5bb3189b067189dab642bfb02dda416f20774d","examples/partials.rs":"0b3ee03668338b9900705b1162ac1f602255d4b691d1827cb603efff318d3166","examples/partials/base0.hbs":"6674275ef68faaeab8a4128da0983c9d732d7552f1791c2e3563fa8c5c66fb5a","examples/partials/base1.hbs":"97b1089705f5a21a6f344190e26133d920d56d4a7fdc1fa2fb7359a720bfe182","examples/partials/template2.hbs":"6f83bc48b774a3b83f9ce5a54bf014fb03514720f9e32834dc68000d06a17618","examples/quick.rs":"96df03fc1742504afae34c6da9da05206adc41f771406da2825b41725329cb2d","examples/render.rs":"eadc1aff65d96c7f95c948fbccfb79981276075f83e19a22214fe0772ef17496","examples/render/template.hbs":"2512ef3362379633790985fe2c40e7efab3ad0f431b7cbec5b7cc644dbbef8f5","examples/render_cli/simple.hbs":"a2e0df51e7c1a25c4e9e1bbe0f4911c7c86200d358fc6c9195b61e89adddc970","examples/render_file.rs":"f5b8e788ac6a71a170c5b315120e8779896df8d9b290fb3d785f51307f5d3c45","examples/render_file/template.hbs":"8ec8d0b61a996391ad7f8b6a914f84d0ac06c62e6d7c9c5fa054ca5e2c64a52e","examples/script.rs":"5e16423dc4c8ae0e383f0d8b9e1a652850fa5e48dbc57cca3757661c3e0476bb","examples/script/goals.rhai":"d756fd7d39f11fae148a6e11d23160da0cdac91c29f716dcb854c07a7db09c80","examples/script/template.hbs":"1f39785157a112bc5c4e94db1361c45a73b024bc8bd0fea0a9d5da8102afb310","profile.sh":"b8e80c59bc12fca93daa67c09001c1c045e594e532831cc957c9ac313f8b2390","release.toml":"d1c1f8e31be9268666c07a2c3f244e73c3db7474a2a64218fac71f7ad1f20b5d","rustfmt.toml":"8e99dabd6aadb112f9f9ed8709e7388b57bf43d19cd08342c093c870534a3f97","src/block.rs":"da38a572a95c3858685e4af82a7e1920c6b3311acf8c118c53c8531b091de391","src/cli.rs":"63aed9a8fb2135ee03bd2b49330be20d2018fe3c36265c14dbdc0da9b73cb6d0","src/context.rs":"6d594b5c93cdc1e8ee08c3858f50dddc312eaa20b9ea3f4c14906bc6ebee318f","src/decorators/inline.rs":"73b8ba6ed98dbf8b3bca228796f47c9139d49f1a1c8d5b4603cc6354098b56c2","src/decorators/mod.rs":"a9189648fd11609fc6681d6df4af0deb1a1958e12c447485a0455d7e67f70fa3","src/error.rs":"a101458e111478fd6c3749910ca7af8afa973d51eb9a4bd13569e66d0aa8ae8f","src/grammar.pest":"a6754e1b61ba282f325af30f907e9e175ad21f0bec322d42e6f975a6f3bf2c7e","src/grammar.rs":"d572c6507f673c1e5c7c018f485672e6c10671d6749d0d9182f26d62e2e1537e","src/helpers/block_util.rs":"11a295215f9c0d14b89f97161468425405386214f050bad07683669a162f9aa1","src/helpers/helper_each.rs":"827de9ba0224cdd361ce52f02a9f301e879d738d6837672798517b83db68b331","src/helpers/helper_extras.rs":"0575a1518eba51cafe91ec2b09666e1c987c9a9bc98cb00193d1e0d203a8b681","src/helpers/helper_if.rs":"2fe6cc5f3b44a42611d02137e5a11466850d44b6a41a803e7a9268f3a545e487","src/helpers/helper_log.rs":"272f7c1f873b97974cce156c04281f2bd8c44ccc885b4c59dd2b43e8d7cc6ef6","src/helpers/helper_lookup.rs":"34e57dbe6a4c65afa8978d32db1b9adfb783990ec951b4833a9986a86cb38ff1","src/helpers/helper_raw.rs":"6b0b5b3774a1d5c3ebf30b1e0b8cac825f6ffb8a18cb9e08bd40786258e4b597","src/helpers/helper_with.rs":"554373544f1aff16799cde954e37a945e26b452414436f612e12b538ec8e1893","src/helpers/mod.rs":"f8c24abb40739935225acdfad97f4bc808eb1fec77d09fda1ff5779b632b7650","src/helpers/scripting.rs":"3716d77e6e11993741885a15dcddaedc11e076f0b5e9a0b844416d3fbb0a834c","src/json/mod.rs":"ef2fc8fe98e9761e2e2a4b2d2293bb29cdb689db2f44f939fc61c48c6b52f0a7","src/json/path.rs":"49b821765da4aa305e51478527898ad4038c3952c7f07c639e8b71a59732e34a","src/json/value.rs":"390ea4fa8b5131a3d00ff1c80d06359220f16d851a5e836192026ea32acbb02e","src/lib.rs":"9374528d680b4cefdfcef945529a5f9c6b03b22ba09503135cc18914ff621d56","src/local_vars.rs":"91d3a16bbfabe2eccecaa9a0dd866ebe88d70ce438d2f18581d1b7d231ba0644","src/macros.rs":"0e2d174bb155da5df279ba15ef65b92519ca890949acc8231c72196bc8364a7c","src/output.rs":"f85acedeb124a1d344c5f73b309bd32d925de5dbed701b5fdebcadbd42f3c7ad","src/partial.rs":"6362967d77d29eea5ba7000ec741774288f08afe7c685e9d28b801b603599401","src/registry.rs":"388ebf2e28734963cd04f6622109e009ab22f7377236f6042aa5441875b22cef","src/render.rs":"17594a82a37295d4887945f18dc12eebe261094078e699b53ff6b7e193fcf986","src/sources.rs":"46989eb76f36edff9dcb5d27488e8bd9c7ff1749f368a70e855f4808c58d7bcf","src/support.rs":"f9328a0674984fcc3c6e93e8a43ec63bf9b502176283f60a2d6ceb15ca34840a","src/template.rs":"5e275cd2adb00e4238607e5e6d7e7db209a1233b813df77e30ccc5df1991bc01","src/util.rs":"2ebc845de5ca47455442a1b6bd664565a52e29928e82c526fbfe56ed5196410f","tests/block_context.rs":"4dce11312d2b6c0c5c2f3104516e5567e5a370611e08f4055fa3653293580385","tests/data_helper.rs":"a7f9d1d42d5415ba1dba459840067acc1294f6f6057d9a5a13d9f7e19469e850","tests/embed.rs":"de85f16a7a0372cc0e150abe3487ae8180598532e4d73b05b4b107e7e4a0b05e","tests/escape.rs":"7b643675b7884a497d7008cda6e51809efea94a79d25996564b7771cfdbf1709","tests/helper_function_lifetime.rs":"635cbd0b44742539bdf36e803a19c6a1a698399f8b765415d53f28df1acfbc2b","tests/helper_macro.rs":"959cc218fa47c8b30835412c5b6b4f76c8387de49e9e2c73baa9a788f9564361","tests/helper_with_space.rs":"0aee174428b799998a9994b008485373a1b084bf4ea49ed455c890eb627f1ac1","tests/root_var.rs":"fda5b30bac1e692fb010f9f98e052d5a525420fece9dcc3821a4e5aeee3a8841","tests/subexpression.rs":"b36ab31adf45272ca984c0c5ed9497820ca072a8805444d69bd089b766786bb5","tests/template_names.rs":"4bbe6b48c974ae7ea1e61806794d846e2f0e8505e1568c5305fa2364dceef68a","tests/templates/hello.hbs":"4aca52692d2247a22c46856dbfd439a5c4edc47237e488ece5d01e9d8030e882","tests/whitespace.rs":"1cadfbe9cd8e2dd4ca7759fdcaf7fd05116b5e9ec59ca67722c41732fe89dfa3","wasm/LICENSE":"63b308fad3db82dc12067a8d7ff4b672fae97d12d0b4b3bb59179e27d640b3a4","wasm/README.md":"d67bad452550d34e9317fb8f4884b8bc07939fbb0dfdcf1be6bfce52a6851fa6","wasm/wapm.toml":"bdb286ccaa18c5c8aa0d2db25755aba9b0e3e83a59fc4d2334c1854933000ea1"},"package":"360d9740069b2f6cbb63ce2dbaa71a20d3185350cbb990d7bebeb9318415eb17"}
\ No newline at end of file +{"files":{"CHANGELOG.md":"c6a001239fb3bdc457cbdaf72acb1240af06a7dd7f6d414d4ead8bec2fe7c247","Cargo.lock":"31844eabc49f5f3a444a0e5dada3ef47a3e65a4e28154add4214d9f0e3160cf4","Cargo.toml":"36bcd2d41ab95f9c00c5fc039aaa6a691371426a37cca69ec85a8cf794a37a62","LICENSE":"63b308fad3db82dc12067a8d7ff4b672fae97d12d0b4b3bb59179e27d640b3a4","README.md":"eb075384e6f8865c44da1e3b1835af4eb8cc1b5cd32ee600719c1a64679392ed","benches/bench.rs":"276ac8c581db35dbdc00e9e4cc1e2e1940fe95522a8f5a19ab088a2c68da61ed","build-wasm.sh":"9f7226d7d0768fe0fba97f698642a4c13a600468ba7d57abcfad9285efd9f4ce","examples/decorator.rs":"249607eea1d2dd0d5f0091e579d4719858a466fa4b353fb91dfff9b20bfc44ce","examples/decorator/template.hbs":"76fd24f08b28b469529f4727321c7cc940198abb5c1aa24d7a6dd2ab42bdda66","examples/dev_mode.rs":"7c8cebbc56da3e834688719f5c10df1c372c059259e40df8534c79a0dda01aab","examples/dev_mode/template.hbs":"4a5e1b81565572e26986d890e4a431953b81893a99ce07cef303e366dd84243c","examples/error.rs":"6f3d4dc945628778d3ef63dccdc7abbf367e214a5ff62a5dcbeb11d8f34317d7","examples/error/error.hbs":"4e8fac806d444a5bc41436fe0a51b4d7850c7645f8996db7a99a821c88622eef","examples/error/template.hbs":"48313b522ddb0dd4285874b96d1b705b841dc141514f440790e904a262955951","examples/helper_macro.rs":"ca0c7b7a45e8f3f8c7fe25d59a5bb3189b067189dab642bfb02dda416f20774d","examples/partials.rs":"0b3ee03668338b9900705b1162ac1f602255d4b691d1827cb603efff318d3166","examples/partials/base0.hbs":"6674275ef68faaeab8a4128da0983c9d732d7552f1791c2e3563fa8c5c66fb5a","examples/partials/base1.hbs":"97b1089705f5a21a6f344190e26133d920d56d4a7fdc1fa2fb7359a720bfe182","examples/partials/template2.hbs":"6f83bc48b774a3b83f9ce5a54bf014fb03514720f9e32834dc68000d06a17618","examples/quick.rs":"96df03fc1742504afae34c6da9da05206adc41f771406da2825b41725329cb2d","examples/render.rs":"993958574b1d635a047c137ac71dbb5e68431959e0fc73591b332f4724da1e46","examples/render/template.hbs":"2512ef3362379633790985fe2c40e7efab3ad0f431b7cbec5b7cc644dbbef8f5","examples/render_cli/simple.hbs":"a2e0df51e7c1a25c4e9e1bbe0f4911c7c86200d358fc6c9195b61e89adddc970","examples/render_file.rs":"8b88386c29926dd0b1ea0459551a1f7b7b74520e88f331a59b676b2738b6d64b","examples/render_file/template.hbs":"8ec8d0b61a996391ad7f8b6a914f84d0ac06c62e6d7c9c5fa054ca5e2c64a52e","examples/script.rs":"5e16423dc4c8ae0e383f0d8b9e1a652850fa5e48dbc57cca3757661c3e0476bb","examples/script/goals.rhai":"d756fd7d39f11fae148a6e11d23160da0cdac91c29f716dcb854c07a7db09c80","examples/script/template.hbs":"1f39785157a112bc5c4e94db1361c45a73b024bc8bd0fea0a9d5da8102afb310","profile.sh":"b8e80c59bc12fca93daa67c09001c1c045e594e532831cc957c9ac313f8b2390","release.toml":"3ef30d82825ad669fbc2b5f888d68e699c811a730256d495460207f648951d5b","rustfmt.toml":"8e99dabd6aadb112f9f9ed8709e7388b57bf43d19cd08342c093c870534a3f97","src/block.rs":"da38a572a95c3858685e4af82a7e1920c6b3311acf8c118c53c8531b091de391","src/cli.rs":"63aed9a8fb2135ee03bd2b49330be20d2018fe3c36265c14dbdc0da9b73cb6d0","src/context.rs":"6d594b5c93cdc1e8ee08c3858f50dddc312eaa20b9ea3f4c14906bc6ebee318f","src/decorators/inline.rs":"73b8ba6ed98dbf8b3bca228796f47c9139d49f1a1c8d5b4603cc6354098b56c2","src/decorators/mod.rs":"12dc54f7c4436bc819e2b04847a28dd242a0d5bc0e9375371d19c6a3803543ed","src/error.rs":"3eafc92349a63df36d9fe1e5f5f66b1f33339e282ddd15850d0dc32bd0f7bea2","src/grammar.pest":"a6754e1b61ba282f325af30f907e9e175ad21f0bec322d42e6f975a6f3bf2c7e","src/grammar.rs":"d572c6507f673c1e5c7c018f485672e6c10671d6749d0d9182f26d62e2e1537e","src/helpers/block_util.rs":"11a295215f9c0d14b89f97161468425405386214f050bad07683669a162f9aa1","src/helpers/helper_each.rs":"827de9ba0224cdd361ce52f02a9f301e879d738d6837672798517b83db68b331","src/helpers/helper_extras.rs":"0575a1518eba51cafe91ec2b09666e1c987c9a9bc98cb00193d1e0d203a8b681","src/helpers/helper_if.rs":"2fe6cc5f3b44a42611d02137e5a11466850d44b6a41a803e7a9268f3a545e487","src/helpers/helper_log.rs":"272f7c1f873b97974cce156c04281f2bd8c44ccc885b4c59dd2b43e8d7cc6ef6","src/helpers/helper_lookup.rs":"34e57dbe6a4c65afa8978d32db1b9adfb783990ec951b4833a9986a86cb38ff1","src/helpers/helper_raw.rs":"6b0b5b3774a1d5c3ebf30b1e0b8cac825f6ffb8a18cb9e08bd40786258e4b597","src/helpers/helper_with.rs":"554373544f1aff16799cde954e37a945e26b452414436f612e12b538ec8e1893","src/helpers/mod.rs":"e43399bdbf96e963cb060e0e39cb82565b4f754ddd14c23a0a2df063dd020f8b","src/helpers/scripting.rs":"3716d77e6e11993741885a15dcddaedc11e076f0b5e9a0b844416d3fbb0a834c","src/json/mod.rs":"ef2fc8fe98e9761e2e2a4b2d2293bb29cdb689db2f44f939fc61c48c6b52f0a7","src/json/path.rs":"49b821765da4aa305e51478527898ad4038c3952c7f07c639e8b71a59732e34a","src/json/value.rs":"390ea4fa8b5131a3d00ff1c80d06359220f16d851a5e836192026ea32acbb02e","src/lib.rs":"bf040f25463b94e10843187c15b69ba750dd34deb4289d45e6306f9a6d685bba","src/local_vars.rs":"91d3a16bbfabe2eccecaa9a0dd866ebe88d70ce438d2f18581d1b7d231ba0644","src/macros.rs":"806d81278c521b34f064ec9e5d1d4793c85f5a55151208d420c6e8ac54db0dee","src/output.rs":"6111adb144d1d4e31f4f95ce25637f5774074317753d1c29e6273efd7f43df5a","src/partial.rs":"fda6ee3733ca64e1bdc85cd809d2d69943bc356eb6c1add2e0540417b4f103a2","src/registry.rs":"9cc93f7f48476b45f59ebd3ab10f16d72af23d87d1211ed13fd6ea79faea1f78","src/render.rs":"5ab5743b24d6c4ece089e6bc91a3848fe1f99062cee658b077721d77f1a75a33","src/sources.rs":"46989eb76f36edff9dcb5d27488e8bd9c7ff1749f368a70e855f4808c58d7bcf","src/support.rs":"f9328a0674984fcc3c6e93e8a43ec63bf9b502176283f60a2d6ceb15ca34840a","src/template.rs":"f51649d84f1f90acf388c02f1a683bcff6de151fa98da2fe0aa370d2d906ad90","src/util.rs":"2ebc845de5ca47455442a1b6bd664565a52e29928e82c526fbfe56ed5196410f","tests/block_context.rs":"4dce11312d2b6c0c5c2f3104516e5567e5a370611e08f4055fa3653293580385","tests/data_helper.rs":"a7f9d1d42d5415ba1dba459840067acc1294f6f6057d9a5a13d9f7e19469e850","tests/embed.rs":"de85f16a7a0372cc0e150abe3487ae8180598532e4d73b05b4b107e7e4a0b05e","tests/escape.rs":"16918484d4684a6d2347dd65972f61d542cc184c5d8ced7a181ba2e2bdf00f22","tests/helper_function_lifetime.rs":"635cbd0b44742539bdf36e803a19c6a1a698399f8b765415d53f28df1acfbc2b","tests/helper_macro.rs":"f05f24df139468a0e2dc48146597cabc39bc33485ae9bb1bb72592b4f06b9bef","tests/helper_with_space.rs":"0aee174428b799998a9994b008485373a1b084bf4ea49ed455c890eb627f1ac1","tests/root_var.rs":"fda5b30bac1e692fb010f9f98e052d5a525420fece9dcc3821a4e5aeee3a8841","tests/subexpression.rs":"b36ab31adf45272ca984c0c5ed9497820ca072a8805444d69bd089b766786bb5","tests/template_names.rs":"4bbe6b48c974ae7ea1e61806794d846e2f0e8505e1568c5305fa2364dceef68a","tests/templates/hello.hbs":"4aca52692d2247a22c46856dbfd439a5c4edc47237e488ece5d01e9d8030e882","tests/whitespace.rs":"1cadfbe9cd8e2dd4ca7759fdcaf7fd05116b5e9ec59ca67722c41732fe89dfa3","wasm/LICENSE":"63b308fad3db82dc12067a8d7ff4b672fae97d12d0b4b3bb59179e27d640b3a4","wasm/README.md":"d67bad452550d34e9317fb8f4884b8bc07939fbb0dfdcf1be6bfce52a6851fa6","wasm/wapm.toml":"bdb286ccaa18c5c8aa0d2db25755aba9b0e3e83a59fc4d2334c1854933000ea1"},"package":"83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d"}
\ No newline at end of file diff --git a/vendor/handlebars/CHANGELOG.md b/vendor/handlebars/CHANGELOG.md index c3b79a657..bc635dbf9 100644 --- a/vendor/handlebars/CHANGELOG.md +++ b/vendor/handlebars/CHANGELOG.md @@ -1,5 +1,28 @@ # Change Log +## [4.3.7](https://github.com/sunng87/handlebars-rust/compare/4.3.6...4.3.7) - 2023-05-11 + +* [Fixed] Use full quanlified name of `Result` in `handlebars_helper` macro [#578] +* [Fixed] Allow single-quote JSON literal [#577] + +## [4.3.6](https://github.com/sunng87/handlebars-rust/compare/4.3.5...4.3.6) - 2022-12-21 + +* [Fixed] Loading template files with multiple extensions, a bug introduced in + 4.3.0 when refactoring directory source. + +## [4.3.5](https://github.com/sunng87/handlebars-rust/compare/4.3.4...4.3.5) - 2022-10-05 + +* [Fixed] Partial context not affected when using with hash context, within a + each/with block [#536] + +## [4.3.4](https://github.com/sunng87/handlebars-rust/compare/4.3.3...4.3.4) - 2022-09-11 + +* [Added] New `write_fmt` function for `Output` [#522] +* [Added] `reason()` method for `TemplateError` to access underlying reason, + this replaces original direct `.reason` access. +* [Changed] Direct access to `TemplateError`'s `reason` field is depreacted will + be removed in future. + ## [4.3.3](https://github.com/sunng87/handlebars-rust/compare/4.3.2...4.3.3) - 2022-07-20 * [Fixed] Disable partial expression indentation with `{{~> partial}}` to diff --git a/vendor/handlebars/Cargo.lock b/vendor/handlebars/Cargo.lock index 27cc86f9b..f140c05c0 100644 --- a/vendor/handlebars/Cargo.lock +++ b/vendor/handlebars/Cargo.lock @@ -29,19 +29,31 @@ dependencies = [ ] [[package]] +name = "ahash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57e6e951cfbb2db8de1828d49073a113a29fd7117b1596caa781a258c7e38d72" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", +] + +[[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.57" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" +checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" [[package]] name = "arrayvec" @@ -54,9 +66,9 @@ dependencies = [ [[package]] name = "ascii" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf56136a5198c7b01a49e3afcbef6cf84597273d298f54432926024107b0109" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "atty" @@ -77,9 +89,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", @@ -98,84 +110,36 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array 0.14.5", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "bstr" -version = "0.2.17" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", + "generic-array", ] [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "bytemuck" -version = "1.9.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" [[package]] name = "bytes" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "cast" -version = "0.2.7" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" -dependencies = [ - "rustc_version", -] +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" @@ -208,9 +172,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.48" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ "cc", ] @@ -226,18 +190,18 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] [[package]] name = "criterion" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" dependencies = [ "atty", "cast", @@ -261,9 +225,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ "cast", "itertools", @@ -271,9 +235,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -281,9 +245,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -292,37 +256,46 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "lazy_static", "memoffset", + "once_cell", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ "cfg-if", - "lazy_static", + "once_cell", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", ] [[package]] name = "csv" -version = "1.1.6" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" dependencies = [ - "bstr", "csv-core", - "itoa 0.4.8", + "itoa 1.0.3", "ryu", "serde", ] @@ -347,33 +320,25 @@ dependencies = [ [[package]] name = "digest" -version = "0.8.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ - "generic-array 0.12.4", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.5", + "block-buffer", + "crypto-common", ] [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", "humantime", @@ -383,16 +348,10 @@ dependencies = [ ] [[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] name = "fastrand" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] @@ -411,34 +370,24 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "generic-array" -version = "0.12.4" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -446,9 +395,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", "libc", @@ -457,9 +406,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" [[package]] name = "half" @@ -469,7 +418,7 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "4.3.3" +version = "4.3.7" dependencies = [ "criterion", "env_logger", @@ -491,9 +440,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" @@ -518,20 +467,19 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.8.1" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", @@ -539,17 +487,17 @@ dependencies = [ [[package]] name = "inferno" -version = "0.11.3" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d4bde3a7105e59c66a4104cfe9606453af1c7a0eac78cb7d5bc263eb762a70" +checksum = "9709543bd6c25fdc748da2bed0f6855b07b7e93a203ae31332ac2101ab2f4782" dependencies = [ - "ahash", + "ahash 0.7.6", "atty", "indexmap", - "itoa 1.0.1", - "lazy_static", + "itoa 1.0.3", "log", "num-format", + "once_cell", "quick-xml", "rgb", "str_stack", @@ -566,9 +514,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -581,15 +529,15 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -602,15 +550,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.125" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -626,18 +574,6 @@ dependencies = [ ] [[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - -[[package]] name = "memchr" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -645,9 +581,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" +checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" dependencies = [ "libc", ] @@ -663,9 +599,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] @@ -678,9 +614,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "nix" -version = "0.24.1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags", "cfg-if", @@ -733,18 +669,18 @@ dependencies = [ [[package]] name = "object" -version = "0.28.4" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.10.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "oorandom" @@ -753,22 +689,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] name = "parking_lot" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -789,24 +713,25 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.1.3" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" dependencies = [ + "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.1.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +checksum = "502b62a6d0245378b04ffe0a7fb4f4419a4815fce813bd8a0ec89a56e07d67b1" dependencies = [ "pest", "pest_generator", @@ -814,9 +739,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.1.3" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +checksum = "451e629bf49b750254da26132f1a5a9d11fd8a95a3df51d15c4abd1ba154cb6c" dependencies = [ "pest", "pest_meta", @@ -827,20 +752,20 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.1.3" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +checksum = "bcec162c71c45e269dfc3fc2916eaeb97feab22993a21bcce4721d08cd7801a6" dependencies = [ - "maplit", + "once_cell", "pest", - "sha-1", + "sha1", ] [[package]] name = "petgraph" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" dependencies = [ "fixedbitset", "indexmap", @@ -848,9 +773,9 @@ dependencies = [ [[package]] name = "plotters" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" dependencies = [ "num-traits", "plotters-backend", @@ -861,24 +786,24 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" [[package]] name = "plotters-svg" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" dependencies = [ "plotters-backend", ] [[package]] name = "pprof" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bba88ee898c63351101af3e60c66c5398c517681ce533eef8caff10ecf11ec1" +checksum = "d6472bfed9475542ac46c518734a8d06d71b0f6cb2c17f904aa301711a57786f" dependencies = [ "backtrace", "cfg-if", @@ -900,18 +825,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" +checksum = "7bd7356a8122b6c4a24a82b278680c73357984ca2fc79a0f9fa6dea7dced7c58" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "prost" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc03e116981ff7d8da8e5c220e374587b98d294af7ba7dd7fda761158f00086f" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" dependencies = [ "bytes", "prost-derive", @@ -919,9 +844,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65a1118354442de7feb8a2a76f3d80ef01426bd45542c8c1fdffca41a758f846" +checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" dependencies = [ "bytes", "cfg-if", @@ -964,18 +889,18 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.22.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -1006,18 +931,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.5.5" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -1025,16 +950,10 @@ dependencies = [ ] [[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - -[[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "remove_dir_all" @@ -1047,20 +966,20 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.32" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74fdc210d8f24a7dbfedc13b04ba5764f5232754ccebfdf5fff1bad791ccbc6" +checksum = "3603b7d71ca82644f79b5a06d1220e9a58ede60bd32255f698cb1af8838b8db3" dependencies = [ "bytemuck", ] [[package]] name = "rhai" -version = "1.7.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f06953bb8b9e4307cb7ccc0d9d018e2ddd25a30d32831f631ce4fe8f17671f7" +checksum = "6eec3a3db30f591ece18c66b3db4c9fa26f3bce20bc821c50550968361f84333" dependencies = [ - "ahash", + "ahash 0.8.0", "bitflags", "instant", "num-traits", @@ -1072,9 +991,9 @@ dependencies = [ [[package]] name = "rhai_codegen" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa0ff1c9dc19c9f8bba510a2a75d3f0449f6233570c2672c7e31c692a11a59a" +checksum = "36791b0b801159db25130fd46ac726d2751c070260bba3a4a0a3eeb6231bb82a" dependencies = [ "proc-macro2", "quote", @@ -1083,9 +1002,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "6.4.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a17e5ac65b318f397182ae94e532da0ba56b88dd1200b774715d36c4943b1c3" +checksum = "e26934cd67a1da1165efe61cba4047cc1b4a526019da609fcce13a1000afb5fa" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1094,9 +1013,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "6.2.0" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e763e24ba2bf0c72bc6be883f967f794a019fafd1b86ba1daff9c91a7edd30" +checksum = "e35d7b402e273544cc08e0824aa3404333fab8a90ac43589d3d5b72f4b346e12" dependencies = [ "proc-macro2", "quote", @@ -1107,9 +1026,9 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "7.2.0" +version = "7.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756feca3afcbb1487a1d01f4ecd94cf8ec98ea074c55a69e7136d29fb6166029" +checksum = "c1669d81dfabd1b5f8e2856b8bbe146c6192b0ba22162edc738ac0a5de18f054" dependencies = [ "sha2", "walkdir", @@ -1122,19 +1041,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] name = "ryu" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "same-file" @@ -1152,16 +1062,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "semver" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" - -[[package]] name = "serde" -version = "1.0.137" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] @@ -1178,9 +1082,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -1189,45 +1093,45 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ - "itoa 1.0.1", + "itoa 1.0.3", "ryu", "serde", ] [[package]] -name = "sha-1" -version = "0.8.2" +name = "sha1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "cfg-if", + "cpufeatures", + "digest", ] [[package]] name = "sha2" -version = "0.9.9" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest", ] [[package]] name = "smallvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +dependencies = [ + "serde", +] [[package]] name = "smartstring" @@ -1236,6 +1140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" dependencies = [ "autocfg", + "serde", "static_assertions", "version_check", ] @@ -1260,9 +1165,9 @@ checksum = "9091b6114800a5f2141aee1d1b9d6ca3592ac062dc5decb3764ec5895a47b4eb" [[package]] name = "symbolic-common" -version = "9.0.0" +version = "9.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea2ab8b85d27d49d184438b4b77fbd521b385cc9c5c802f60e784f2df25a03d" +checksum = "800963ba330b09a2ae4a4f7c6392b81fbc2784099a98c1eac68c3437aa9382b2" dependencies = [ "debugid", "memmap2", @@ -1272,9 +1177,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "9.0.0" +version = "9.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7939b15a1c62633d1fce17f8a7b668312eaa2d3b117bf4ced5e6e77870c43b6a" +checksum = "2b940a1fdbc72bb3369e38714efe6cd332dbbe46d093cf03d668b9ac390d1ad0" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -1283,13 +1188,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.94" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a07e33e919ebcd69113d5be0e4d70c5707004ff45188910106854f38b960df4a" +checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1326,18 +1231,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" dependencies = [ "proc-macro2", "quote", @@ -1346,11 +1251,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.9" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b" dependencies = [ - "itoa 1.0.1", + "itoa 1.0.3", "libc", "num_threads", "serde", @@ -1397,9 +1302,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "typenum" @@ -1409,46 +1314,45 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "unicode-xid" -version = "0.2.3" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] @@ -1477,15 +1381,15 @@ dependencies = [ [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1493,13 +1397,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -1508,9 +1412,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1518,9 +1422,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -1531,15 +1435,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -1547,13 +1451,13 @@ dependencies = [ [[package]] name = "which" -version = "4.2.5" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] diff --git a/vendor/handlebars/Cargo.toml b/vendor/handlebars/Cargo.toml index f40384c26..31086c497 100644 --- a/vendor/handlebars/Cargo.toml +++ b/vendor/handlebars/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.57" name = "handlebars" -version = "4.3.3" +version = "4.3.7" authors = ["Ning Sun <sunng@pm.me>"] description = "Handlebars templating implemented in Rust." homepage = "https://github.com/sunng87/handlebars-rust" @@ -30,7 +30,6 @@ categories = [ ] license = "MIT" repository = "https://github.com/sunng87/handlebars-rust" -resolver = "2" [package.metadata.docs.rs] features = [ diff --git a/vendor/handlebars/README.md b/vendor/handlebars/README.md index 18d21abfb..1ad099726 100644 --- a/vendor/handlebars/README.md +++ b/vendor/handlebars/README.md @@ -180,6 +180,7 @@ scriptable without changing rust code. * Actix: [handlebars example](https://github.com/actix/examples/blob/master/templating/handlebars/src/main.rs) * Tide: [tide-handlebars](https://github.com/No9/tide-handlebars) +* Axum: [axum-template](https://github.com/Altair-Bueno/axum-template) ### Adopters diff --git a/vendor/handlebars/examples/decorator.rs b/vendor/handlebars/examples/decorator.rs index 81aa6fe8d..6d5357ba0 100644 --- a/vendor/handlebars/examples/decorator.rs +++ b/vendor/handlebars/examples/decorator.rs @@ -23,8 +23,7 @@ fn format_helper( let param = h .param(0) .ok_or(RenderError::new("Param 0 is required for format helper."))?; - let rendered = format!("{} pts", param.value().render()); - out.write(rendered.as_ref())?; + write!(out, "{} pts", param.value().render())?; Ok(()) } @@ -51,8 +50,7 @@ fn format_decorator( let param = h .param(0) .ok_or(RenderError::new("Param 0 is required for format helper."))?; - let rendered = format!("{} {}", param.value().render(), suffix); - out.write(rendered.as_ref())?; + write!(out, "{} {}", param.value().render(), suffix)?; Ok(()) }, ), diff --git a/vendor/handlebars/examples/render.rs b/vendor/handlebars/examples/render.rs index 112ec504d..a6f26d0da 100644 --- a/vendor/handlebars/examples/render.rs +++ b/vendor/handlebars/examples/render.rs @@ -24,8 +24,7 @@ fn format_helper( let param = h .param(0) .ok_or(RenderError::new("Param 0 is required for format helper."))?; - let rendered = format!("{} pts", param.value().render()); - out.write(rendered.as_ref())?; + write!(out, "{} pts", param.value().render())?; Ok(()) } diff --git a/vendor/handlebars/examples/render_file.rs b/vendor/handlebars/examples/render_file.rs index 7b7599672..786308608 100644 --- a/vendor/handlebars/examples/render_file.rs +++ b/vendor/handlebars/examples/render_file.rs @@ -27,8 +27,7 @@ fn format_helper( let param = h .param(0) .ok_or(RenderError::new("Param 0 is required for format helper."))?; - let rendered = format!("{} pts", param.value().render()); - out.write(rendered.as_ref())?; + write!(out, "{} pts", param.value().render())?; Ok(()) } diff --git a/vendor/handlebars/release.toml b/vendor/handlebars/release.toml index 6ee7a8383..fd11783ee 100644 --- a/vendor/handlebars/release.toml +++ b/vendor/handlebars/release.toml @@ -1,6 +1,5 @@ sign-commit = true sign-tag = true -dev-version = true pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", prerelease=false}, {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", prerelease=false}, diff --git a/vendor/handlebars/src/decorators/mod.rs b/vendor/handlebars/src/decorators/mod.rs index bd2d23458..8633c1d5f 100644 --- a/vendor/handlebars/src/decorators/mod.rs +++ b/vendor/handlebars/src/decorators/mod.rs @@ -230,14 +230,14 @@ mod test { _: &mut RenderContext<'_, '_>, out: &mut dyn Output| -> Result<(), RenderError> { - let s = format!( + write!( + out, "{}m", h.param(0) .as_ref() .map(|v| v.value()) .unwrap_or(&to_json(0)) - ); - out.write(s.as_ref())?; + )?; Ok(()) }, ), @@ -262,15 +262,15 @@ mod test { _: &mut RenderContext<'_, '_>, out: &mut dyn Output| -> Result<(), RenderError> { - let s = format!( + write!( + out, "{}{}", h.param(0) .as_ref() .map(|v| v.value()) .unwrap_or(&to_json(0)), new_unit - ); - out.write(s.as_ref())?; + )?; Ok(()) }; diff --git a/vendor/handlebars/src/error.rs b/vendor/handlebars/src/error.rs index 618d68e4f..160986350 100644 --- a/vendor/handlebars/src/error.rs +++ b/vendor/handlebars/src/error.rs @@ -1,4 +1,3 @@ -// use std::backtrace::Backtrace; use std::error::Error as StdError; use std::fmt::{self, Write}; use std::io::Error as IOError; @@ -152,6 +151,7 @@ pub enum TemplateErrorReason { /// Error on parsing template. #[derive(Debug, Error)] pub struct TemplateError { + #[deprecated(note = "public access to reason to be removed soon, use .reason() instead.")] pub reason: TemplateErrorReason, pub template_name: Option<String>, pub line_no: Option<usize>, @@ -160,6 +160,7 @@ pub struct TemplateError { } impl TemplateError { + #[allow(deprecated)] pub fn of(e: TemplateErrorReason) -> TemplateError { TemplateError { reason: e, @@ -181,6 +182,12 @@ impl TemplateError { self.template_name = Some(name); self } + + /// Get underlying reason for the error + #[allow(deprecated)] + pub fn reason(&self) -> &TemplateErrorReason { + &self.reason + } } impl From<(IOError, String)> for TemplateError { @@ -229,16 +236,16 @@ impl fmt::Display for TemplateError { (Some(line), Some(col), &Some(ref seg)) => writeln!( f, "Template error: {}\n --> Template error in \"{}\":{}:{}\n |\n{} |\n = reason: {}", - self.reason, + self.reason(), self.template_name .as_ref() .unwrap_or(&"Unnamed template".to_owned()), line, col, seg, - self.reason + self.reason() ), - _ => write!(f, "{}", self.reason), + _ => write!(f, "{}", self.reason()), } } } diff --git a/vendor/handlebars/src/helpers/mod.rs b/vendor/handlebars/src/helpers/mod.rs index ff5fa2495..8019f46f9 100644 --- a/vendor/handlebars/src/helpers/mod.rs +++ b/vendor/handlebars/src/helpers/mod.rs @@ -208,15 +208,11 @@ mod test { ) -> Result<(), RenderError> { let v = h.param(0).unwrap(); - if !h.is_block() { - let output = format!("{}:{}", h.name(), v.value().render()); - out.write(output.as_ref())?; - } else { - let output = format!("{}:{}", h.name(), v.value().render()); - out.write(output.as_ref())?; + write!(out, "{}:{}", h.name(), v.value().render())?; + if h.is_block() { out.write("->")?; h.template().unwrap().render(r, ctx, rc, out)?; - }; + } Ok(()) } } @@ -258,8 +254,7 @@ mod test { _: &mut RenderContext<'_, '_>, out: &mut dyn Output| -> Result<(), RenderError> { - let output = format!("{}{}", h.name(), h.param(0).unwrap().value()); - out.write(output.as_ref())?; + write!(out, "{}{}", h.name(), h.param(0).unwrap().value())?; Ok(()) }, ), @@ -273,8 +268,7 @@ mod test { _: &mut RenderContext<'_, '_>, out: &mut dyn Output| -> Result<(), RenderError> { - let output = format!("{}", h.hash_get("value").unwrap().value().render()); - out.write(output.as_ref())?; + write!(out, "{}", h.hash_get("value").unwrap().value().render())?; Ok(()) }, ), diff --git a/vendor/handlebars/src/lib.rs b/vendor/handlebars/src/lib.rs index 1f9ab1ed3..1cb9e79ee 100644 --- a/vendor/handlebars/src/lib.rs +++ b/vendor/handlebars/src/lib.rs @@ -1,5 +1,7 @@ -#![doc(html_root_url = "https://docs.rs/handlebars/4.3.3")] +#![doc(html_root_url = "https://docs.rs/handlebars/4.3.7")] #![cfg_attr(docsrs, feature(doc_cfg))] +#![allow(unknown_lints)] +#![allow(clippy::result_large_err)] //! # Handlebars //! //! [Handlebars](http://handlebarsjs.com/) is a modern and extensible templating solution originally created in the JavaScript world. It's used by many popular frameworks like [Ember.js](http://emberjs.com) and Chaplin. It's also ported to some other platforms such as [Java](https://github.com/jknack/handlebars.java). diff --git a/vendor/handlebars/src/macros.rs b/vendor/handlebars/src/macros.rs index bd1eab0bb..2d893acab 100644 --- a/vendor/handlebars/src/macros.rs +++ b/vendor/handlebars/src/macros.rs @@ -54,7 +54,7 @@ macro_rules! handlebars_helper { r: &'reg $crate::Handlebars<'reg>, _: &'rc $crate::Context, _: &mut $crate::RenderContext<'reg, 'rc>, - ) -> Result<$crate::ScopedJson<'reg, 'rc>, $crate::RenderError> { + ) -> std::result::Result<$crate::ScopedJson<'reg, 'rc>, $crate::RenderError> { let mut param_idx = 0; $( diff --git a/vendor/handlebars/src/output.rs b/vendor/handlebars/src/output.rs index 67e62b849..12075b365 100644 --- a/vendor/handlebars/src/output.rs +++ b/vendor/handlebars/src/output.rs @@ -6,6 +6,19 @@ use std::string::FromUtf8Error; /// Handlebars uses this trait to define rendered output. pub trait Output { fn write(&mut self, seg: &str) -> Result<(), IOError>; + + /// Designed to be used with `write!` macro. + /// for backward compatibility and to avoid breakage the default implementation + /// uses `format!` this may be not what you want. + fn write_fmt(&mut self, args: std::fmt::Arguments<'_>) -> Result<(), IOError> { + // Check if there is nothing to format to avoid allocation on case like + // write!(out, "hey")?; + if let Some(content) = args.as_str() { + self.write(content) + } else { + self.write(&std::fmt::format(args)) + } + } } pub struct WriteOutput<W: Write> { @@ -16,6 +29,10 @@ impl<W: Write> Output for WriteOutput<W> { fn write(&mut self, seg: &str) -> Result<(), IOError> { self.write.write_all(seg.as_bytes()) } + + fn write_fmt(&mut self, args: std::fmt::Arguments<'_>) -> Result<(), IOError> { + self.write.write_fmt(args) + } } impl<W: Write> WriteOutput<W> { @@ -33,6 +50,10 @@ impl Output for StringOutput { self.buf.extend_from_slice(seg.as_bytes()); Ok(()) } + + fn write_fmt(&mut self, args: std::fmt::Arguments<'_>) -> Result<(), IOError> { + self.buf.write_fmt(args) + } } impl StringOutput { diff --git a/vendor/handlebars/src/partial.rs b/vendor/handlebars/src/partial.rs index bcf9803fd..6c41091f4 100644 --- a/vendor/handlebars/src/partial.rs +++ b/vendor/handlebars/src/partial.rs @@ -72,7 +72,6 @@ pub fn expand_partial<'reg: 'rc, 'rc>( local_rc.dec_partial_block_depth(); } - let mut block = None; let mut block_created = false; // create context if param given @@ -80,7 +79,15 @@ pub fn expand_partial<'reg: 'rc, 'rc>( // path given, update base_path let mut block_inner = BlockContext::new(); *block_inner.base_path_mut() = base_path.to_vec(); - block = Some(block_inner); + + // because block is moved here, we need another bool variable to track + // its status for later cleanup + block_created = true; + // clear blocks to prevent block params from parent + // template to be leaked into partials + // see `test_partial_context_issue_495` for the case. + local_rc.clear_blocks(); + local_rc.push_block(block_inner); } if !d.hash().is_empty() { @@ -91,31 +98,34 @@ pub fn expand_partial<'reg: 'rc, 'rc>( .map(|(k, v)| (*k, v.value())) .collect::<HashMap<&str, &Json>>(); + // create block if we didn't (no param provided for partial expression) + if !block_created { + let block_inner = if let Some(block) = local_rc.block() { + // reuse current block information, including base_path and + // base_value if any + block.clone() + } else { + BlockContext::new() + }; + + local_rc.clear_blocks(); + local_rc.push_block(block_inner); + } + + // evaluate context within current block, this includes block + // context provided by partial expression parameter let merged_context = merge_json( local_rc.evaluate2(ctx, &Path::current())?.as_json(), &hash_ctx, ); - if let Some(ref mut block_inner) = block { - block_inner.set_base_value(merged_context); - } else { - let mut block_inner = BlockContext::new(); - block_inner.set_base_value(merged_context); - block = Some(block_inner); + // update the base value, there must be a block for this so it's + // also safe to unwrap. + if let Some(block) = local_rc.block_mut() { + block.set_base_value(merged_context); } } - if let Some(block_inner) = block { - // because block is moved here, we need another bool variable to track - // its status for later cleanup - block_created = true; - // clear blocks to prevent block params from parent - // template to be leaked into partials - // see `test_partial_context_issue_495` for the case. - local_rc.clear_blocks(); - local_rc.push_block(block_inner); - } - // @partial-block if let Some(pb) = d.template() { local_rc.push_partial_block(pb); @@ -654,3 +664,22 @@ outer third line"#, ) } } + +#[test] +fn test_issue_534() { + let t1 = "{{title}}"; + let t2 = "{{#each modules}}{{> (lookup this \"module\") content name=0}}{{/each}}"; + + let data = json!({ + "modules": [ + {"module": "t1", "content": {"title": "foo"}}, + {"module": "t1", "content": {"title": "bar"}}, + ] + }); + + let mut hbs = Registry::new(); + hbs.register_template_string("t1", t1).unwrap(); + hbs.register_template_string("t2", t2).unwrap(); + + assert_eq!("foobar", hbs.render("t2", &data).unwrap()); +} diff --git a/vendor/handlebars/src/registry.rs b/vendor/handlebars/src/registry.rs index 438f8573c..d84dba715 100644 --- a/vendor/handlebars/src/registry.rs +++ b/vendor/handlebars/src/registry.rs @@ -298,22 +298,13 @@ impl<'reg> Registry<'reg> { { let dir_path = dir_path.as_ref(); - // Allowing dots at the beginning as to not break old - // applications. - let tpl_extension = tpl_extension.strip_prefix('.').unwrap_or(tpl_extension); - let walker = WalkDir::new(dir_path); let dir_iter = walker .min_depth(1) .into_iter() .filter_map(|e| e.ok().map(|e| e.into_path())) // Checks if extension matches - .filter(|tpl_path| { - tpl_path - .extension() - .map(|extension| extension == tpl_extension) - .unwrap_or(false) - }) + .filter(|tpl_path| tpl_path.to_string_lossy().ends_with(tpl_extension)) // Rejects any hidden or temporary files. .filter(|tpl_path| { tpl_path @@ -327,12 +318,16 @@ impl<'reg> Registry<'reg> { .strip_prefix(dir_path) .ok() .map(|tpl_canonical_name| { - tpl_canonical_name - .with_extension("") + let tpl_name = tpl_canonical_name .components() .map(|component| component.as_os_str().to_string_lossy()) .collect::<Vec<_>>() - .join("/") + .join("/"); + + tpl_name + .strip_suffix(tpl_extension) + .map(|s| s.to_owned()) + .unwrap_or(tpl_name) }) .map(|tpl_canonical_name| (tpl_canonical_name, tpl_path)) }); @@ -609,7 +604,7 @@ impl<'reg> Registry<'reg> { T: Serialize, { let mut output = StringOutput::new(); - let ctx = Context::wraps(&data)?; + let ctx = Context::wraps(data)?; self.render_to_output(name, &ctx, &mut output)?; output.into_string().map_err(RenderError::from) } @@ -908,6 +903,31 @@ mod test { drop(file1); dir.close().unwrap(); } + + { + let dir = tempdir().unwrap(); + let mut r = Registry::new(); + + let file1_path = dir.path().join("t11.hbs.html"); + let mut file1: File = File::create(&file1_path).unwrap(); + writeln!(file1, "<h1>Bonjour {{world}}!</h1>").unwrap(); + + let mut dir_path = dir + .path() + .to_string_lossy() + .replace(std::path::MAIN_SEPARATOR, "/"); + if !dir_path.ends_with("/") { + dir_path.push('/'); + } + r.register_templates_directory(".hbs.html", dir_path) + .unwrap(); + + assert_eq!(r.templates.len(), 1); + assert_eq!(r.templates.contains_key("t11"), true); + + drop(file1); + dir.close().unwrap(); + } } #[test] diff --git a/vendor/handlebars/src/render.rs b/vendor/handlebars/src/render.rs index 036352b3a..6d7418e12 100644 --- a/vendor/handlebars/src/render.rs +++ b/vendor/handlebars/src/render.rs @@ -874,315 +874,333 @@ impl Evaluable for TemplateElement { } } -#[test] -fn test_raw_string() { - let r = Registry::new(); - let raw_string = RawString("<h1>hello world</h1>".to_string()); - - let mut out = StringOutput::new(); - let ctx = Context::null(); - { - let mut rc = RenderContext::new(None); - raw_string.render(&r, &ctx, &mut rc, &mut out).ok().unwrap(); - } - assert_eq!( - out.into_string().unwrap(), - "<h1>hello world</h1>".to_string() - ); -} - -#[test] -fn test_expression() { - let r = Registry::new(); - let element = Expression(Box::new(HelperTemplate::with_path(Path::with_named_paths( - &["hello"], - )))); - - let mut out = StringOutput::new(); - let mut m: BTreeMap<String, String> = BTreeMap::new(); - let value = "<p></p>".to_string(); - m.insert("hello".to_string(), value); - let ctx = Context::wraps(&m).unwrap(); - { - let mut rc = RenderContext::new(None); - element.render(&r, &ctx, &mut rc, &mut out).ok().unwrap(); - } - - assert_eq!( - out.into_string().unwrap(), - "<p></p>".to_string() - ); -} - -#[test] -fn test_html_expression() { - let r = Registry::new(); - let element = HtmlExpression(Box::new(HelperTemplate::with_path(Path::with_named_paths( - &["hello"], - )))); - - let mut out = StringOutput::new(); - let mut m: BTreeMap<String, String> = BTreeMap::new(); - let value = "world"; - m.insert("hello".to_string(), value.to_string()); - let ctx = Context::wraps(&m).unwrap(); - { - let mut rc = RenderContext::new(None); - element.render(&r, &ctx, &mut rc, &mut out).ok().unwrap(); +#[cfg(test)] +mod test { + use std::collections::BTreeMap; + + use super::{Helper, RenderContext, Renderable}; + use crate::block::BlockContext; + use crate::context::Context; + use crate::error::RenderError; + use crate::json::path::Path; + use crate::json::value::JsonRender; + use crate::output::{Output, StringOutput}; + use crate::registry::Registry; + use crate::template::TemplateElement::*; + use crate::template::{HelperTemplate, Template, TemplateElement}; + + #[test] + fn test_raw_string() { + let r = Registry::new(); + let raw_string = RawString("<h1>hello world</h1>".to_string()); + + let mut out = StringOutput::new(); + let ctx = Context::null(); + { + let mut rc = RenderContext::new(None); + raw_string.render(&r, &ctx, &mut rc, &mut out).ok().unwrap(); + } + assert_eq!( + out.into_string().unwrap(), + "<h1>hello world</h1>".to_string() + ); } - assert_eq!(out.into_string().unwrap(), value.to_string()); -} - -#[test] -fn test_template() { - let r = Registry::new(); - let mut out = StringOutput::new(); - let mut m: BTreeMap<String, String> = BTreeMap::new(); - let value = "world".to_string(); - m.insert("hello".to_string(), value); - let ctx = Context::wraps(&m).unwrap(); - - let elements: Vec<TemplateElement> = vec![ - RawString("<h1>".to_string()), - Expression(Box::new(HelperTemplate::with_path(Path::with_named_paths( + #[test] + fn test_expression() { + let r = Registry::new(); + let element = Expression(Box::new(HelperTemplate::with_path(Path::with_named_paths( &["hello"], - )))), - RawString("</h1>".to_string()), - Comment("".to_string()), - ]; + )))); - let template = Template { - elements, - name: None, - mapping: Vec::new(), - }; + let mut out = StringOutput::new(); + let mut m: BTreeMap<String, String> = BTreeMap::new(); + let value = "<p></p>".to_string(); + m.insert("hello".to_string(), value); + let ctx = Context::wraps(&m).unwrap(); + { + let mut rc = RenderContext::new(None); + element.render(&r, &ctx, &mut rc, &mut out).ok().unwrap(); + } - { - let mut rc = RenderContext::new(None); - template.render(&r, &ctx, &mut rc, &mut out).ok().unwrap(); + assert_eq!( + out.into_string().unwrap(), + "<p></p>".to_string() + ); } - assert_eq!(out.into_string().unwrap(), "<h1>world</h1>".to_string()); -} - -#[test] -fn test_render_context_promotion_and_demotion() { - use crate::json::value::to_json; - let mut render_context = RenderContext::new(None); - let mut block = BlockContext::new(); - - block.set_local_var("index", to_json(0)); - render_context.push_block(block); - - render_context.push_block(BlockContext::new()); - assert_eq!( - render_context.get_local_var(1, "index").unwrap(), - &to_json(0) - ); - - render_context.pop_block(); - - assert_eq!( - render_context.get_local_var(0, "index").unwrap(), - &to_json(0) - ); -} + #[test] + fn test_html_expression() { + let r = Registry::new(); + let element = HtmlExpression(Box::new(HelperTemplate::with_path(Path::with_named_paths( + &["hello"], + )))); -#[test] -fn test_render_subexpression_issue_115() { - use crate::support::str::StringWriter; - - let mut r = Registry::new(); - r.register_helper( - "format", - Box::new( - |h: &Helper<'_, '_>, - _: &Registry<'_>, - _: &Context, - _: &mut RenderContext<'_, '_>, - out: &mut dyn Output| - -> Result<(), RenderError> { - out.write(format!("{}", h.param(0).unwrap().value().render()).as_ref()) - .map(|_| ()) - .map_err(RenderError::from) - }, - ), - ); + let mut out = StringOutput::new(); + let mut m: BTreeMap<String, String> = BTreeMap::new(); + let value = "world"; + m.insert("hello".to_string(), value.to_string()); + let ctx = Context::wraps(&m).unwrap(); + { + let mut rc = RenderContext::new(None); + element.render(&r, &ctx, &mut rc, &mut out).ok().unwrap(); + } - let mut sw = StringWriter::new(); - let mut m: BTreeMap<String, String> = BTreeMap::new(); - m.insert("a".to_string(), "123".to_string()); + assert_eq!(out.into_string().unwrap(), value.to_string()); + } + + #[test] + fn test_template() { + let r = Registry::new(); + let mut out = StringOutput::new(); + let mut m: BTreeMap<String, String> = BTreeMap::new(); + let value = "world".to_string(); + m.insert("hello".to_string(), value); + let ctx = Context::wraps(&m).unwrap(); + + let elements: Vec<TemplateElement> = vec![ + RawString("<h1>".to_string()), + Expression(Box::new(HelperTemplate::with_path(Path::with_named_paths( + &["hello"], + )))), + RawString("</h1>".to_string()), + Comment("".to_string()), + ]; + + let template = Template { + elements, + name: None, + mapping: Vec::new(), + }; - { - if let Err(e) = r.render_template_to_write("{{format (format a)}}", &m, &mut sw) { - panic!("{}", e); + { + let mut rc = RenderContext::new(None); + template.render(&r, &ctx, &mut rc, &mut out).ok().unwrap(); } - } - - assert_eq!(sw.into_string(), "123".to_string()); -} -#[test] -fn test_render_error_line_no() { - let mut r = Registry::new(); - let m: BTreeMap<String, String> = BTreeMap::new(); + assert_eq!(out.into_string().unwrap(), "<h1>world</h1>".to_string()); + } + + #[test] + fn test_render_context_promotion_and_demotion() { + use crate::json::value::to_json; + let mut render_context = RenderContext::new(None); + let mut block = BlockContext::new(); + + block.set_local_var("index", to_json(0)); + render_context.push_block(block); + + render_context.push_block(BlockContext::new()); + assert_eq!( + render_context.get_local_var(1, "index").unwrap(), + &to_json(0) + ); + + render_context.pop_block(); + + assert_eq!( + render_context.get_local_var(0, "index").unwrap(), + &to_json(0) + ); + } + + #[test] + fn test_render_subexpression_issue_115() { + use crate::support::str::StringWriter; + + let mut r = Registry::new(); + r.register_helper( + "format", + Box::new( + |h: &Helper<'_, '_>, + _: &Registry<'_>, + _: &Context, + _: &mut RenderContext<'_, '_>, + out: &mut dyn Output| + -> Result<(), RenderError> { + out.write(&h.param(0).unwrap().value().render()) + .map(|_| ()) + .map_err(RenderError::from) + }, + ), + ); + + let mut sw = StringWriter::new(); + let mut m: BTreeMap<String, String> = BTreeMap::new(); + m.insert("a".to_string(), "123".to_string()); - let name = "invalid_template"; - assert!(r - .register_template_string(name, "<h1>\n{{#if true}}\n {{#each}}{{/each}}\n{{/if}}") - .is_ok()); + { + if let Err(e) = r.render_template_to_write("{{format (format a)}}", &m, &mut sw) { + panic!("{}", e); + } + } - if let Err(e) = r.render(name, &m) { - assert_eq!(e.line_no.unwrap(), 3); - assert_eq!(e.column_no.unwrap(), 3); - assert_eq!(e.template_name, Some(name.to_owned())); - } else { - panic!("Error expected"); + assert_eq!(sw.into_string(), "123".to_string()); } -} -#[test] -fn test_partial_failback_render() { - let mut r = Registry::new(); + #[test] + fn test_render_error_line_no() { + let mut r = Registry::new(); + let m: BTreeMap<String, String> = BTreeMap::new(); - assert!(r - .register_template_string("parent", "<html>{{> layout}}</html>") - .is_ok()); - assert!(r - .register_template_string( - "child", - "{{#*inline \"layout\"}}content{{/inline}}{{#> parent}}{{> seg}}{{/parent}}" - ) - .is_ok()); - assert!(r.register_template_string("seg", "1234").is_ok()); - - let r = r.render("child", &true).expect("should work"); - assert_eq!(r, "<html>content</html>"); -} - -#[test] -fn test_key_with_slash() { - let mut r = Registry::new(); - - assert!(r - .register_template_string("t", "{{#each this}}{{@key}}: {{this}}\n{{/each}}") - .is_ok()); - - let r = r.render("t", &json!({"/foo": "bar"})).unwrap(); - - assert_eq!(r, "/foo: bar\n"); -} - -#[test] -fn test_comment() { - let r = Registry::new(); - - assert_eq!( - r.render_template("Hello {{this}} {{! test me }}", &0) - .unwrap(), - "Hello 0 " - ); -} - -#[test] -fn test_zero_args_heler() { - let mut r = Registry::new(); - - r.register_helper( - "name", - Box::new( - |_: &Helper<'_, '_>, - _: &Registry<'_>, - _: &Context, - _: &mut RenderContext<'_, '_>, - out: &mut dyn Output| - -> Result<(), RenderError> { out.write("N/A").map_err(Into::into) }, - ), - ); - - r.register_template_string("t0", "Output name: {{name}}") - .unwrap(); - r.register_template_string("t1", "Output name: {{first_name}}") - .unwrap(); - r.register_template_string("t2", "Output name: {{./name}}") - .unwrap(); - - // when "name" is available in context, use context first - assert_eq!( - r.render("t0", &json!({"name": "Alex"})).unwrap(), - "Output name: N/A" - ); + let name = "invalid_template"; + assert!(r + .register_template_string(name, "<h1>\n{{#if true}}\n {{#each}}{{/each}}\n{{/if}}") + .is_ok()); - // when "name" is unavailable, call helper with same name - assert_eq!( - r.render("t2", &json!({"name": "Alex"})).unwrap(), - "Output name: Alex" - ); - - // output nothing when neither context nor helper available - assert_eq!( - r.render("t1", &json!({"name": "Alex"})).unwrap(), - "Output name: " - ); - - // generate error in strict mode for above case - r.set_strict_mode(true); - assert!(r.render("t1", &json!({"name": "Alex"})).is_err()); - - // output nothing when helperMissing was defined - r.set_strict_mode(false); - r.register_helper( - "helperMissing", - Box::new( - |h: &Helper<'_, '_>, - _: &Registry<'_>, - _: &Context, - _: &mut RenderContext<'_, '_>, - out: &mut dyn Output| - -> Result<(), RenderError> { - let name = h.name(); - out.write(&format!("{} not resolved", name))?; - Ok(()) - }, - ), - ); - assert_eq!( - r.render("t1", &json!({"name": "Alex"})).unwrap(), - "Output name: first_name not resolved" - ); -} - -#[test] -fn test_identifiers_starting_with_numbers() { - let mut r = Registry::new(); - - assert!(r - .register_template_string("r1", "{{#if 0a}}true{{/if}}") - .is_ok()); - let r1 = r.render("r1", &json!({"0a": true})).unwrap(); - assert_eq!(r1, "true"); - - assert!(r.register_template_string("r2", "{{eq 1a 1}}").is_ok()); - let r2 = r.render("r2", &json!({"1a": 2, "a": 1})).unwrap(); - assert_eq!(r2, "false"); + if let Err(e) = r.render(name, &m) { + assert_eq!(e.line_no.unwrap(), 3); + assert_eq!(e.column_no.unwrap(), 3); + assert_eq!(e.template_name, Some(name.to_owned())); + } else { + panic!("Error expected"); + } + } - assert!(r + #[test] + fn test_partial_failback_render() { + let mut r = Registry::new(); + + assert!(r + .register_template_string("parent", "<html>{{> layout}}</html>") + .is_ok()); + assert!(r + .register_template_string( + "child", + "{{#*inline \"layout\"}}content{{/inline}}{{#> parent}}{{> seg}}{{/parent}}" + ) + .is_ok()); + assert!(r.register_template_string("seg", "1234").is_ok()); + + let r = r.render("child", &true).expect("should work"); + assert_eq!(r, "<html>content</html>"); + } + + #[test] + fn test_key_with_slash() { + let mut r = Registry::new(); + + assert!(r + .register_template_string("t", "{{#each this}}{{@key}}: {{this}}\n{{/each}}") + .is_ok()); + + let r = r.render("t", &json!({"/foo": "bar"})).unwrap(); + + assert_eq!(r, "/foo: bar\n"); + } + + #[test] + fn test_comment() { + let r = Registry::new(); + + assert_eq!( + r.render_template("Hello {{this}} {{! test me }}", &0) + .unwrap(), + "Hello 0 " + ); + } + + #[test] + fn test_zero_args_heler() { + let mut r = Registry::new(); + + r.register_helper( + "name", + Box::new( + |_: &Helper<'_, '_>, + _: &Registry<'_>, + _: &Context, + _: &mut RenderContext<'_, '_>, + out: &mut dyn Output| + -> Result<(), RenderError> { + out.write("N/A").map_err(Into::into) + }, + ), + ); + + r.register_template_string("t0", "Output name: {{name}}") + .unwrap(); + r.register_template_string("t1", "Output name: {{first_name}}") + .unwrap(); + r.register_template_string("t2", "Output name: {{./name}}") + .unwrap(); + + // when "name" is available in context, use context first + assert_eq!( + r.render("t0", &json!({"name": "Alex"})).unwrap(), + "Output name: N/A" + ); + + // when "name" is unavailable, call helper with same name + assert_eq!( + r.render("t2", &json!({"name": "Alex"})).unwrap(), + "Output name: Alex" + ); + + // output nothing when neither context nor helper available + assert_eq!( + r.render("t1", &json!({"name": "Alex"})).unwrap(), + "Output name: " + ); + + // generate error in strict mode for above case + r.set_strict_mode(true); + assert!(r.render("t1", &json!({"name": "Alex"})).is_err()); + + // output nothing when helperMissing was defined + r.set_strict_mode(false); + r.register_helper( + "helperMissing", + Box::new( + |h: &Helper<'_, '_>, + _: &Registry<'_>, + _: &Context, + _: &mut RenderContext<'_, '_>, + out: &mut dyn Output| + -> Result<(), RenderError> { + let name = h.name(); + write!(out, "{} not resolved", name)?; + Ok(()) + }, + ), + ); + assert_eq!( + r.render("t1", &json!({"name": "Alex"})).unwrap(), + "Output name: first_name not resolved" + ); + } + + #[test] + fn test_identifiers_starting_with_numbers() { + let mut r = Registry::new(); + + assert!(r + .register_template_string("r1", "{{#if 0a}}true{{/if}}") + .is_ok()); + let r1 = r.render("r1", &json!({"0a": true})).unwrap(); + assert_eq!(r1, "true"); + + assert!(r.register_template_string("r2", "{{eq 1a 1}}").is_ok()); + let r2 = r.render("r2", &json!({"1a": 2, "a": 1})).unwrap(); + assert_eq!(r2, "false"); + + assert!(r .register_template_string("r3", "0: {{0}} {{#if (eq 0 true)}}resolved from context{{/if}}\n1a: {{1a}} {{#if (eq 1a true)}}resolved from context{{/if}}\n2_2: {{2_2}} {{#if (eq 2_2 true)}}resolved from context{{/if}}") // YUP it is just eq that barfs! is if handled specially? maybe this test should go nearer to specific helpers that fail? .is_ok()); - let r3 = r - .render("r3", &json!({"0": true, "1a": true, "2_2": true})) - .unwrap(); - assert_eq!( - r3, - "0: true \n1a: true resolved from context\n2_2: true resolved from context" - ); - - // these should all be errors: - assert!(r.register_template_string("r4", "{{eq 1}}").is_ok()); - assert!(r.register_template_string("r5", "{{eq a1}}").is_ok()); - assert!(r.register_template_string("r6", "{{eq 1a}}").is_ok()); - assert!(r.render("r4", &()).is_err()); - assert!(r.render("r5", &()).is_err()); - assert!(r.render("r6", &()).is_err()); + let r3 = r + .render("r3", &json!({"0": true, "1a": true, "2_2": true})) + .unwrap(); + assert_eq!( + r3, + "0: true \n1a: true resolved from context\n2_2: true resolved from context" + ); + + // these should all be errors: + assert!(r.register_template_string("r4", "{{eq 1}}").is_ok()); + assert!(r.register_template_string("r5", "{{eq a1}}").is_ok()); + assert!(r.register_template_string("r6", "{{eq 1a}}").is_ok()); + assert!(r.render("r4", &()).is_err()); + assert!(r.render("r5", &()).is_err()); + assert!(r.render("r6", &()).is_err()); + } } diff --git a/vendor/handlebars/src/template.rs b/vendor/handlebars/src/template.rs index 617f47711..4bde14859 100644 --- a/vendor/handlebars/src/template.rs +++ b/vendor/handlebars/src/template.rs @@ -288,11 +288,33 @@ impl Template { Parameter::Path(Path::new(param_span.as_str(), path_segs)) } Rule::literal => { - let s = param_span.as_str(); - if let Ok(json) = Json::from_str(s) { + // Parse the parameter as a JSON literal + let param_literal = it.next().unwrap(); + let json_result = match param_literal.as_rule() { + Rule::string_literal + if it.peek().unwrap().as_rule() == Rule::string_inner_single_quote => + { + // ...unless the parameter is a single-quoted string. + // In that case, transform it to a double-quoted string + // and then parse it as a JSON literal. + let string_inner_single_quote = it.next().unwrap(); + let double_quoted = format!( + "\"{}\"", + string_inner_single_quote + .as_str() + .replace("\\'", "'") + .replace('"', "\\\"") + ); + Json::from_str(&double_quoted) + } + _ => Json::from_str(param_span.as_str()), + }; + if let Ok(json) = json_result { Parameter::Literal(json) } else { - Parameter::Name(s.to_owned()) + return Err(TemplateError::of(TemplateErrorReason::InvalidParam( + param_span.as_str().to_owned(), + ))); } } Rule::subexpression => { @@ -508,8 +530,8 @@ impl Template { } } - pub(crate) fn compile2<'a>( - source: &'a str, + pub(crate) fn compile2( + source: &str, options: TemplateOptions, ) -> Result<Template, TemplateError> { let mut helper_stack: VecDeque<HelperTemplate> = VecDeque::new(); @@ -1010,7 +1032,7 @@ mod test { let terr = Template::compile(source).unwrap_err(); - assert!(matches!(terr.reason, TemplateErrorReason::InvalidSyntax)); + assert!(matches!(terr.reason(), TemplateErrorReason::InvalidSyntax)); assert_eq!(terr.line_no.unwrap(), 4); assert_eq!(terr.column_no.unwrap(), 5); } @@ -1126,16 +1148,10 @@ mod test { let sources = ["{{invalid", "{{{invalid", "{{invalid}", "{{!hello"]; for s in sources.iter() { let result = Template::compile(s.to_owned()); - if let Err(e) = result { - match e.reason { - TemplateErrorReason::InvalidSyntax => {} - _ => { - panic!("Unexpected error type {}", e); - } - } - } else { - panic!("Undetected error"); - } + assert!(matches!( + *result.unwrap_err().reason(), + TemplateErrorReason::InvalidSyntax + )); } } @@ -1316,6 +1332,6 @@ mod test { let s = "{{#>(X)}}{{/X}}"; let result = Template::compile(s); assert!(result.is_err()); - assert_eq!("decorator \"Subexpression(Subexpression { element: Expression(HelperTemplate { name: Path(Relative(([Named(\\\"X\\\")], \\\"X\\\"))), params: [], hash: {}, block_param: None, template: None, inverse: None, block: false }) })\" was opened, but \"X\" is closing", format!("{}", result.unwrap_err().reason)); + assert_eq!("decorator \"Subexpression(Subexpression { element: Expression(HelperTemplate { name: Path(Relative(([Named(\\\"X\\\")], \\\"X\\\"))), params: [], hash: {}, block_param: None, template: None, inverse: None, block: false }) })\" was opened, but \"X\" is closing", format!("{}", result.unwrap_err().reason())); } } diff --git a/vendor/handlebars/tests/escape.rs b/vendor/handlebars/tests/escape.rs index 4a737f5ce..2b9512290 100644 --- a/vendor/handlebars/tests/escape.rs +++ b/vendor/handlebars/tests/escape.rs @@ -27,19 +27,44 @@ fn test_string_no_escape_422() { handlebars_helper!(replace: |input: str, from: str, to: str| { input.replace(from, to) }); + handlebars_helper!(echo: |input: str| { + input + }); hbs.register_helper("replace", Box::new(replace)); + hbs.register_helper("echo", Box::new(echo)); assert_eq!( r#"some\ path"#, hbs.render_template(r#"{{replace "some/path" "/" "\\ " }}"#, &()) .unwrap() ); + assert_eq!( + r#"some\ path"#, + hbs.render_template(r#"{{replace 'some/path' '/' '\\ ' }}"#, &()) + .unwrap() + ); assert_eq!( r#"some\path"#, hbs.render_template(r#"{{replace "some/path" "/" "\\" }}"#, &()) .unwrap() ); + assert_eq!( + r#"some\path"#, + hbs.render_template(r#"{{replace 'some/path' '/' '\\' }}"#, &()) + .unwrap() + ); + + assert_eq!( + r#"double-quoted \ 'with' "nesting""#, + hbs.render_template(r#"{{echo "double-quoted \\ 'with' \"nesting\""}}"#, &()) + .unwrap() + ); + assert_eq!( + r#"single-quoted \ 'with' "nesting""#, + hbs.render_template(r#"{{echo 'single-quoted \\ \'with\' "nesting"'}}"#, &()) + .unwrap() + ); } #[test] diff --git a/vendor/handlebars/tests/helper_macro.rs b/vendor/handlebars/tests/helper_macro.rs index cc5ed914b..f40ab778a 100644 --- a/vendor/handlebars/tests/helper_macro.rs +++ b/vendor/handlebars/tests/helper_macro.rs @@ -86,4 +86,24 @@ fn test_macro_helper() { .unwrap(), "2015-02-18" ); + + assert_eq!( + hbs.render_template("{{eq image.link null}}", &json!({"image": {"link": null}})) + .unwrap(), + "true" + ); + + assert_eq!( + hbs.render_template( + "{{eq image.link null}}", + &json!({"image": {"link": "https://url"}}) + ) + .unwrap(), + "false" + ); + + assert_eq!( + hbs.render_template("{{tag 'html'}}", &()).unwrap(), + "<html>" + ); } |