difftreelog
Merge branch 'master' into gc-v2
in: master
17 files changed
Cargo.lockdiffbeforeafterboth63 packageslockfile v3
Might be heavy and slow!
annotate-snippets
0.9.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c96c3d1062ea7101741480185a6a1275eab01cbe8b20e378d1311bc056d2e08depends onused byanyhow
1.0.40crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063bused byatty
0.2.14crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8depends onused byautocfg
1.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464aused bybase64
0.13.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fdused bybincode
1.3.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcaddepends onused bybitflags
1.2.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693used bycc
1.0.67crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fdused byclap
3.0.0-beta.2github.com/clap-rs/clap↘ 10↖ 3sourcegit+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9depends onclap_derive
3.0.0-beta.2github.com/clap-rs/clap↘ 5↖ 1sourcegit+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9used byclap_generate
3.0.0-beta.2github.com/clap-rs/clap↘ 1↖ 1sourcegit+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9depends onused bygc
0.4.1crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3edaac0f5832202ebc99520cb77c932248010c4645d20be1dc62d6579f5b3752depends ongc_derive
0.4.1crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum60df8444f094ff7885631d80e78eb7d88c3c2361a98daaabb06256e4500db941used byhashbrown
0.9.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04used byheck
0.3.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6acdepends onused byhermit-abi
0.1.18crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5cdepends onused byindexmap
1.6.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3depends onused byitoa
0.4.7crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736used byjrsonnet
0.3.8workspace↘ 7↖ 0jrsonnet-cli
0.3.8workspace↘ 3↖ 1jrsonnet-evaluator
0.3.8workspace↘ 15↖ 3jrsonnet-interner
0.3.8workspace↘ 3↖ 3jrsonnet-parser
0.3.8workspace↘ 6↖ 4jrsonnet-stdlib
0.3.8workspace↘ 0↖ 2jrsonnet-types
0.3.8workspace↘ 2↖ 1used byjsonnet
0.3.8workspace↘ 4↖ 0lazy_static
1.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646used bylibc
0.2.94crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5emd5
0.7.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771used bymimalloc-sys
0.1.6crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4aa3cefb626f6ae3d0b2f71c5378c89d2b1d4d7bc246b0ca9a7ee61a4daad291depends onused bymimallocator
0.1.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2d44fe4ebf6b538fcf39d9975c2b90bb3232d1ba8e8bffeacd004f27b20c577adepends onused byos_str_bytes
3.0.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume293568965aea261bdf010db17df7030e3c9a275c415d51d6112f7cf9b7af012used bypathdiff
0.2.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum877630b3de15c0b64cc52f659345724fbf6bdad9bd9566699fc53688f3c34a34used bypeg
0.7.0crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166adepends onpeg-macros
0.7.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844cused bypeg-runtime
0.7.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088used byproc-macro-error
1.0.4crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumda25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38cused byproc-macro-error-attr
1.0.4crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869used byproc-macro2
1.0.26crates.io↘ 1↖ 10sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cecdepends onquote
1.0.9crates.io↘ 1↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7depends onrustc-hash
1.1.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2ryu
1.0.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86eused byserde
1.0.125crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171depends onserde_derive
1.0.125crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06ddepends onused byserde_json
1.0.64crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79depends onused bystrsim
0.10.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623used bysyn
1.0.71crates.io↘ 3↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumad184cc9470f9117b2ac6817bfe297307418819ba40552f9b3846f05c33d5373synstructure
0.12.4crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701used bytermcolor
1.1.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4depends onused bytextwrap
0.13.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcd05616119e612a8041ef58f2b578906cc2531a6069047ae092cfb86a325d835depends onused bythiserror
1.0.24crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98edepends onthiserror-impl
1.0.24crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0depends onused byunescape
0.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6eused byunicode-segmentation
1.7.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796used byunicode-width
0.1.8crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3unicode-xid
0.2.2crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3vec_map
0.8.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191used byversion_check
0.9.3crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fewinapi
0.3.9crates.io↘ 2↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419winapi-i686-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6used bywinapi-util
0.1.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178depends onused bywinapi-x86_64-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183fused byyansi-term
0.1.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1depends onused by
63 packageslockfile v3
Might be heavy and slow!
annotate-snippets
0.9.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c96c3d1062ea7101741480185a6a1275eab01cbe8b20e378d1311bc056d2e08depends onused byanyhow
1.0.40crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063bused byatty
0.2.14crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8depends onused byautocfg
1.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464aused bybase64
0.13.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fdused bybincode
1.3.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcaddepends onused bybitflags
1.2.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693used bycc
1.0.67crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fdused byclap
3.0.0-beta.2github.com/clap-rs/clap↘ 10↖ 3sourcegit+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9depends onclap_derive
3.0.0-beta.2github.com/clap-rs/clap↘ 5↖ 1sourcegit+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9used byclap_generate
3.0.0-beta.2github.com/clap-rs/clap↘ 1↖ 1sourcegit+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9depends onused bygc
0.4.1crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3edaac0f5832202ebc99520cb77c932248010c4645d20be1dc62d6579f5b3752depends ongc_derive
0.4.1crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum60df8444f094ff7885631d80e78eb7d88c3c2361a98daaabb06256e4500db941used byhashbrown
0.9.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04used byheck
0.3.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6acdepends onused byhermit-abi
0.1.18crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5cdepends onused byindexmap
1.6.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3depends onused byitoa
0.4.7crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736used byjrsonnet
0.3.8workspace↘ 7↖ 0jrsonnet-cli
0.3.8workspace↘ 3↖ 1jrsonnet-evaluator
0.3.8workspace↘ 15↖ 3jrsonnet-interner
0.3.8workspace↘ 3↖ 2jrsonnet-parser
0.3.8workspace↘ 6↖ 4jrsonnet-stdlib
0.3.8workspace↘ 0↖ 2jrsonnet-types
0.3.8workspace↘ 2↖ 1used byjsonnet
0.3.8workspace↘ 3↖ 0lazy_static
1.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646used bylibc
0.2.94crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5emd5
0.7.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771used bymimalloc-sys
0.1.6crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4aa3cefb626f6ae3d0b2f71c5378c89d2b1d4d7bc246b0ca9a7ee61a4daad291depends onused bymimallocator
0.1.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2d44fe4ebf6b538fcf39d9975c2b90bb3232d1ba8e8bffeacd004f27b20c577adepends onused byos_str_bytes
3.0.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume293568965aea261bdf010db17df7030e3c9a275c415d51d6112f7cf9b7af012used bypathdiff
0.2.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum877630b3de15c0b64cc52f659345724fbf6bdad9bd9566699fc53688f3c34a34used bypeg
0.7.0crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166adepends onpeg-macros
0.7.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844cused bypeg-runtime
0.7.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088used byproc-macro-error
1.0.4crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumda25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38cused byproc-macro-error-attr
1.0.4crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869used byproc-macro2
1.0.26crates.io↘ 1↖ 10sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cecdepends onquote
1.0.9crates.io↘ 1↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7depends onrustc-hash
1.1.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2ryu
1.0.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86eused byserde
1.0.125crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171depends onserde_derive
1.0.125crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06ddepends onused byserde_json
1.0.64crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79depends onused bystrsim
0.10.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623used bysyn
1.0.71crates.io↘ 3↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumad184cc9470f9117b2ac6817bfe297307418819ba40552f9b3846f05c33d5373synstructure
0.12.4crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701used bytermcolor
1.1.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4depends onused bytextwrap
0.13.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcd05616119e612a8041ef58f2b578906cc2531a6069047ae092cfb86a325d835depends onused bythiserror
1.0.24crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98edepends onthiserror-impl
1.0.24crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0depends onused byunescape
0.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6eused byunicode-segmentation
1.7.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796used byunicode-width
0.1.8crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3unicode-xid
0.2.2crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3vec_map
0.8.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191used byversion_check
0.9.3crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fewinapi
0.3.9crates.io↘ 2↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419winapi-i686-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6used bywinapi-util
0.1.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178depends onused bywinapi-x86_64-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183fused byyansi-term
0.1.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1depends onused by
bindings/jsonnet/Cargo.tomldiffbeforeafterboth--- a/bindings/jsonnet/Cargo.toml
+++ b/bindings/jsonnet/Cargo.toml
@@ -8,7 +8,6 @@
publish = false
[dependencies]
-jrsonnet-interner = { path = "../../crates/jrsonnet-interner", version = "0.3.8" }
jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.3.8" }
jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.3.8" }
gc = { version = "0.4.1", features = ["derive"] }
bindings/jsonnet/src/import.rsdiffbeforeafterboth--- a/bindings/jsonnet/src/import.rs
+++ b/bindings/jsonnet/src/import.rs
@@ -2,9 +2,8 @@
use jrsonnet_evaluator::{
error::{Error::*, Result},
- throw, EvaluationState, ImportResolver,
+ throw, EvaluationState, IStr, ImportResolver,
};
-use jrsonnet_interner::IStr;
use std::{
any::Any,
cell::RefCell,
@@ -13,7 +12,7 @@
fs::File,
io::Read,
os::raw::{c_char, c_int},
- path::PathBuf,
+ path::{Path, PathBuf},
ptr::null_mut,
rc::Rc,
};
@@ -34,7 +33,7 @@
out: RefCell<HashMap<PathBuf, IStr>>,
}
impl ImportResolver for CallbackImportResolver {
- fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>> {
+ fn resolve_file(&self, from: &Path, path: &Path) -> Result<Rc<Path>> {
let base = CString::new(from.to_str().unwrap()).unwrap().into_raw();
let rel = CString::new(path.to_str().unwrap()).unwrap().into_raw();
let found_here: *mut c_char = null_mut();
@@ -74,9 +73,9 @@
unsafe { CString::from_raw(result_ptr) };
}
- Ok(Rc::new(found_here_buf))
+ Ok(found_here_buf.into())
}
- fn load_file_contents(&self, resolved: &PathBuf) -> Result<IStr> {
+ fn load_file_contents(&self, resolved: &Path) -> Result<IStr> {
Ok(self.out.borrow().get(resolved).unwrap().clone())
}
unsafe fn as_any(&self) -> &dyn Any {
@@ -109,27 +108,27 @@
}
}
impl ImportResolver for NativeImportResolver {
- fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>> {
- let mut new_path = from.clone();
+ fn resolve_file(&self, from: &Path, path: &Path) -> Result<Rc<Path>> {
+ let mut new_path = from.to_owned();
new_path.push(path);
if new_path.exists() {
- Ok(Rc::new(new_path))
+ Ok(new_path.into())
} else {
for library_path in self.library_paths.borrow().iter() {
let mut cloned = library_path.clone();
cloned.push(path);
if cloned.exists() {
- return Ok(Rc::new(cloned));
+ return Ok(cloned.into());
}
}
- throw!(ImportFileNotFound(from.clone(), path.clone()))
+ throw!(ImportFileNotFound(from.to_owned(), path.to_owned()))
}
}
- fn load_file_contents(&self, id: &PathBuf) -> Result<IStr> {
- let mut file = File::open(id).map_err(|_e| ResolvedFileNotFound(id.clone()))?;
+ fn load_file_contents(&self, id: &Path) -> Result<IStr> {
+ let mut file = File::open(id).map_err(|_e| ResolvedFileNotFound(id.to_owned()))?;
let mut out = String::new();
file.read_to_string(&mut out)
- .map_err(|_e| ImportBadFileUtf8(id.clone()))?;
+ .map_err(|_e| ImportBadFileUtf8(id.to_owned()))?;
Ok(out.into())
}
unsafe fn as_any(&self) -> &dyn Any {
bindings/jsonnet/src/lib.rsdiffbeforeafterboth--- a/bindings/jsonnet/src/lib.rs
+++ b/bindings/jsonnet/src/lib.rs
@@ -9,14 +9,12 @@
pub mod vars_tlas;
use import::NativeImportResolver;
-use jrsonnet_evaluator::{EvaluationState, ManifestFormat, Val};
-use jrsonnet_interner::IStr;
+use jrsonnet_evaluator::{EvaluationState, IStr, ManifestFormat, Val};
use std::{
alloc::Layout,
ffi::{CStr, CString},
os::raw::{c_char, c_double, c_int, c_uint},
path::PathBuf,
- rc::Rc,
};
/// WASM stub
@@ -145,7 +143,7 @@
let snippet = CStr::from_ptr(snippet);
match vm
.evaluate_snippet_raw(
- Rc::new(PathBuf::from(filename.to_str().unwrap())),
+ PathBuf::from(filename.to_str().unwrap()).into(),
snippet.to_str().unwrap().into(),
)
.and_then(|v| vm.with_tla(v))
@@ -221,7 +219,7 @@
let snippet = CStr::from_ptr(snippet);
match vm
.evaluate_snippet_raw(
- Rc::new(PathBuf::from(filename.to_str().unwrap())),
+ PathBuf::from(filename.to_str().unwrap()).into(),
snippet.to_str().unwrap().into(),
)
.and_then(|v| vm.with_tla(v))
@@ -295,7 +293,7 @@
let snippet = CStr::from_ptr(snippet);
match vm
.evaluate_snippet_raw(
- Rc::new(PathBuf::from(filename.to_str().unwrap())),
+ PathBuf::from(filename.to_str().unwrap()).into(),
snippet.to_str().unwrap().into(),
)
.and_then(|v| vm.with_tla(v))
bindings/jsonnet/src/native.rsdiffbeforeafterboth--- a/bindings/jsonnet/src/native.rs
+++ b/bindings/jsonnet/src/native.rs
@@ -8,7 +8,7 @@
use std::{
ffi::{c_void, CStr},
os::raw::{c_char, c_int},
- path::PathBuf,
+ path::Path,
rc::Rc,
};
@@ -27,7 +27,7 @@
unsafe_empty_trace!();
}
impl NativeCallbackHandler for JsonnetNativeCallbackHandler {
- fn call(&self, _from: Option<Rc<PathBuf>>, args: &[Val]) -> Result<Val, LocError> {
+ fn call(&self, _from: Option<Rc<Path>>, args: &[Val]) -> Result<Val, LocError> {
let mut n_args = Vec::new();
for a in args {
n_args.push(Some(Box::new(a.clone())));
cmds/jrsonnet/src/main.rsdiffbeforeafterboth--- a/cmds/jrsonnet/src/main.rs
+++ b/cmds/jrsonnet/src/main.rs
@@ -6,7 +6,6 @@
io::Read,
io::Write,
path::PathBuf,
- rc::Rc,
str::FromStr,
};
@@ -134,14 +133,14 @@
let val = if opts.input.exec {
state.set_manifest_format(ManifestFormat::ToString);
state.evaluate_snippet_raw(
- Rc::new(PathBuf::from("args")),
+ PathBuf::from("args").into(),
(&opts.input.input as &str).into(),
)?
} else if opts.input.input == "-" {
let mut input = Vec::new();
std::io::stdin().read_to_end(&mut input)?;
let input_str = std::str::from_utf8(&input)?.into();
- state.evaluate_snippet_raw(Rc::new(PathBuf::from("<stdin>")), input_str)?
+ state.evaluate_snippet_raw(PathBuf::from("<stdin>").into(), input_str)?
} else {
state.evaluate_file_raw(&PathBuf::from(opts.input.input))?
};
crates/jrsonnet-evaluator/build.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/build.rs
+++ b/crates/jrsonnet-evaluator/build.rs
@@ -15,7 +15,7 @@
let parsed = parse(
STDLIB_STR,
&ParserSettings {
- file_name: Rc::new(PathBuf::from("std.jsonnet")),
+ file_name: PathBuf::from("std.jsonnet").into(),
loc_data: true,
},
)
crates/jrsonnet-evaluator/src/builtin/mod.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/builtin/mod.rs
+++ b/crates/jrsonnet-evaluator/src/builtin/mod.rs
@@ -177,7 +177,7 @@
0, s: ty!(string) => Val::Str;
], {
let state = EvaluationState::default();
- let path = Rc::new(PathBuf::from("std.parseJson"));
+ let path = PathBuf::from("std.parseJson").into();
state.evaluate_snippet_raw(path ,s)
})
}
crates/jrsonnet-evaluator/src/builtin/stdlib.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/builtin/stdlib.rs
+++ b/crates/jrsonnet-evaluator/src/builtin/stdlib.rs
@@ -1,5 +1,5 @@
use jrsonnet_parser::{LocExpr, ParserSettings};
-use std::{path::PathBuf, rc::Rc};
+use std::path::PathBuf;
thread_local! {
/// To avoid parsing again when issued from the same thread
@@ -25,7 +25,7 @@
jrsonnet_stdlib::STDLIB_STR,
&ParserSettings {
loc_data: true,
- file_name: Rc::new(PathBuf::from("std.jsonnet")),
+ file_name: PathBuf::from("std.jsonnet").into(),
},
)
.unwrap()
crates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/error.rs
+++ b/crates/jrsonnet-evaluator/src/error.rs
@@ -6,7 +6,10 @@
use jrsonnet_interner::IStr;
use jrsonnet_parser::{BinaryOpType, ExprLocation, UnaryOpType};
use jrsonnet_types::ValType;
-use std::{path::PathBuf, rc::Rc};
+use std::{
+ path::{Path, PathBuf},
+ rc::Rc,
+};
use thiserror::Error;
#[derive(Error, Debug, Clone, Trace, Finalize)]
@@ -87,7 +90,7 @@
.source_code.chars().nth(error.location.offset).map(|c| c.to_string()).unwrap_or_else(|| "EOF".into())
)]
ImportSyntaxError {
- path: Rc<PathBuf>,
+ path: Rc<Path>,
source_code: IStr,
#[unsafe_ignore_trace]
error: Box<jrsonnet_parser::ParseError>,
crates/jrsonnet-evaluator/src/evaluate.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/evaluate.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate.rs
@@ -12,7 +12,7 @@
};
use jrsonnet_types::ValType;
use rustc_hash::{FxHashMap, FxHasher};
-use std::{collections::HashMap, hash::BuildHasherDefault, rc::Rc};
+use std::{collections::HashMap, hash::BuildHasherDefault};
pub fn evaluate_binding_in_future(
b: &BindSpec,
@@ -843,26 +843,26 @@
}
}
Import(path) => {
- let mut tmp = loc
+ let tmp = loc
.clone()
.expect("imports cannot be used without loc_data")
.0;
- let import_location = Rc::make_mut(&mut tmp);
+ let mut import_location = tmp.to_path_buf();
import_location.pop();
push(
loc.as_ref(),
|| format!("import {:?}", path),
- || with_state(|s| s.import_file(import_location, path)),
+ || with_state(|s| s.import_file(&import_location, path)),
)?
}
ImportStr(path) => {
- let mut tmp = loc
+ let tmp = loc
.clone()
.expect("imports cannot be used without loc_data")
.0;
- let import_location = Rc::make_mut(&mut tmp);
+ let mut import_location = tmp.to_path_buf();
import_location.pop();
- Val::Str(with_state(|s| s.import_file_str(import_location, path))?)
+ Val::Str(with_state(|s| s.import_file_str(&import_location, path))?)
}
})
}
crates/jrsonnet-evaluator/src/import.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/import.rs
+++ b/crates/jrsonnet-evaluator/src/import.rs
@@ -6,17 +6,23 @@
use jrsonnet_interner::IStr;
use std::fs;
use std::io::Read;
-use std::{any::Any, cell::RefCell, collections::HashMap, path::PathBuf, rc::Rc};
+use std::{
+ any::Any,
+ cell::RefCell,
+ collections::HashMap,
+ path::{Path, PathBuf},
+ rc::Rc,
+};
/// Implements file resolution logic for `import` and `importStr`
pub trait ImportResolver {
/// Resolves real file path, e.g. `(/home/user/manifests, b.libjsonnet)` can correspond
/// both to `/home/user/manifests/b.libjsonnet` and to `/home/user/${vendor}/b.libjsonnet`
/// where `${vendor}` is a library path.
- fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>>;
+ fn resolve_file(&self, from: &Path, path: &Path) -> Result<Rc<Path>>;
/// Reads file from filesystem, should be used only with path received from `resolve_file`
- fn load_file_contents(&self, resolved: &PathBuf) -> Result<IStr>;
+ fn load_file_contents(&self, resolved: &Path) -> Result<IStr>;
/// # Safety
///
@@ -29,11 +35,11 @@
/// Dummy resolver, can't resolve/load any file
pub struct DummyImportResolver;
impl ImportResolver for DummyImportResolver {
- fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>> {
- throw!(ImportNotSupported(from.clone(), path.clone()))
+ fn resolve_file(&self, from: &Path, path: &Path) -> Result<Rc<Path>> {
+ throw!(ImportNotSupported(from.into(), path.into()))
}
- fn load_file_contents(&self, _resolved: &PathBuf) -> Result<IStr> {
+ fn load_file_contents(&self, _resolved: &Path) -> Result<IStr> {
// Can be only caused by library direct consumer, not by supplied jsonnet
panic!("dummy resolver can't load any file")
}
@@ -57,27 +63,27 @@
pub library_paths: Vec<PathBuf>,
}
impl ImportResolver for FileImportResolver {
- fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>> {
- let mut new_path = from.clone();
- new_path.push(path);
- if new_path.exists() {
- Ok(Rc::new(new_path))
+ fn resolve_file(&self, from: &Path, path: &Path) -> Result<Rc<Path>> {
+ let mut direct = from.to_path_buf();
+ direct.push(path);
+ if direct.exists() {
+ Ok(direct.into())
} else {
for library_path in self.library_paths.iter() {
let mut cloned = library_path.clone();
cloned.push(path);
if cloned.exists() {
- return Ok(Rc::new(cloned));
+ return Ok(cloned.into());
}
}
- throw!(ImportFileNotFound(from.clone(), path.clone()))
+ throw!(ImportFileNotFound(from.to_owned(), path.to_owned()))
}
}
- fn load_file_contents(&self, id: &PathBuf) -> Result<IStr> {
- let mut file = File::open(id).map_err(|_e| ResolvedFileNotFound(id.clone()))?;
+ fn load_file_contents(&self, id: &Path) -> Result<IStr> {
+ let mut file = File::open(id).map_err(|_e| ResolvedFileNotFound(id.to_owned()))?;
let mut out = String::new();
file.read_to_string(&mut out)
- .map_err(|_e| ImportBadFileUtf8(id.clone()))?;
+ .map_err(|_e| ImportBadFileUtf8(id.to_owned()))?;
Ok(out.into())
}
unsafe fn as_any(&self) -> &dyn Any {
@@ -89,23 +95,23 @@
/// Caches results of the underlying resolver
pub struct CachingImportResolver {
- resolution_cache: RefCell<HashMap<ResolutionData, Result<Rc<PathBuf>>>>,
+ resolution_cache: RefCell<HashMap<ResolutionData, Result<Rc<Path>>>>,
loading_cache: RefCell<HashMap<PathBuf, Result<IStr>>>,
inner: Box<dyn ImportResolver>,
}
impl ImportResolver for CachingImportResolver {
- fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>> {
+ fn resolve_file(&self, from: &Path, path: &Path) -> Result<Rc<Path>> {
self.resolution_cache
.borrow_mut()
- .entry((from.clone(), path.clone()))
+ .entry((from.to_owned(), path.to_owned()))
.or_insert_with(|| self.inner.resolve_file(from, path))
.clone()
}
- fn load_file_contents(&self, resolved: &PathBuf) -> Result<IStr> {
+ fn load_file_contents(&self, resolved: &Path) -> Result<IStr> {
self.loading_cache
.borrow_mut()
- .entry(resolved.clone())
+ .entry(resolved.to_owned())
.or_insert_with(|| self.inner.load_file_contents(resolved))
.clone()
}
crates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/lib.rs
+++ b/crates/jrsonnet-evaluator/src/lib.rs
@@ -27,7 +27,7 @@
pub use function::parse_function_call;
use gc::{Finalize, Gc, Trace};
pub use import::*;
-use jrsonnet_interner::IStr;
+pub use jrsonnet_interner::IStr;
use jrsonnet_parser::*;
use native::NativeCallback;
pub use obj::*;
@@ -37,7 +37,7 @@
collections::HashMap,
fmt::Debug,
hash::BuildHasherDefault,
- path::PathBuf,
+ path::{Path, PathBuf},
rc::Rc,
};
use trace::{offset_to_location, CodeLocation, CompactFormat, TraceFormat};
@@ -110,8 +110,8 @@
/// Used for stack overflow detection, stacktrace is populated on unwind
stack_depth: usize,
/// Contains file source codes and evaluation results for imports and pretty-printed stacktraces
- files: HashMap<Rc<PathBuf>, FileData>,
- str_files: HashMap<Rc<PathBuf>, IStr>,
+ files: HashMap<Rc<Path>, FileData>,
+ str_files: HashMap<Rc<Path>, IStr>,
}
pub struct FileData {
@@ -157,7 +157,7 @@
impl EvaluationState {
/// Parses and adds file as loaded
- pub fn add_file(&self, path: Rc<PathBuf>, source_code: IStr) -> Result<()> {
+ pub fn add_file(&self, path: Rc<Path>, source_code: IStr) -> Result<()> {
self.add_parsed_file(
path.clone(),
source_code.clone(),
@@ -170,7 +170,7 @@
)
.map_err(|error| ImportSyntaxError {
error: Box::new(error),
- path,
+ path: path.to_owned(),
source_code,
})?,
)?;
@@ -181,7 +181,7 @@
/// Adds file by source code and parsed expr
pub fn add_parsed_file(
&self,
- name: Rc<PathBuf>,
+ name: Rc<Path>,
source_code: IStr,
parsed: LocExpr,
) -> Result<()> {
@@ -196,20 +196,20 @@
Ok(())
}
- pub fn get_source(&self, name: &PathBuf) -> Option<IStr> {
+ pub fn get_source(&self, name: &Path) -> Option<IStr> {
let ro_map = &self.data().files;
ro_map.get(name).map(|value| value.source_code.clone())
}
- pub fn map_source_locations(&self, file: &PathBuf, locs: &[usize]) -> Vec<CodeLocation> {
+ pub fn map_source_locations(&self, file: &Path, locs: &[usize]) -> Vec<CodeLocation> {
offset_to_location(&self.get_source(file).unwrap(), locs)
}
- pub(crate) fn import_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Val> {
+ pub(crate) fn import_file(&self, from: &Path, path: &Path) -> Result<Val> {
let file_path = self.resolve_file(from, path)?;
{
let data = self.data();
let files = &data.files;
- if files.contains_key(&file_path) {
+ if files.contains_key(&file_path as &Path) {
drop(data);
return self.evaluate_loaded_file_raw(&file_path);
}
@@ -218,7 +218,7 @@
self.add_file(file_path.clone(), contents)?;
self.evaluate_loaded_file_raw(&file_path)
}
- pub(crate) fn import_file_str(&self, from: &PathBuf, path: &PathBuf) -> Result<IStr> {
+ pub(crate) fn import_file_str(&self, from: &Path, path: &Path) -> Result<IStr> {
let path = self.resolve_file(from, path)?;
if !self.data().str_files.contains_key(&path) {
let file_str = self.load_file_contents(&path)?;
@@ -227,7 +227,7 @@
Ok(self.data().str_files.get(&path).cloned().unwrap())
}
- fn evaluate_loaded_file_raw(&self, name: &PathBuf) -> Result<Val> {
+ fn evaluate_loaded_file_raw(&self, name: &Path) -> Result<Val> {
let expr: LocExpr = {
let ro_map = &self.data().files;
let value = ro_map
@@ -253,7 +253,7 @@
/// Adds standard library global variable (std) to this evaluator
pub fn with_stdlib(&self) -> &Self {
use jrsonnet_stdlib::STDLIB_STR;
- let std_path = Rc::new(PathBuf::from("std.jsonnet"));
+ let std_path: Rc<Path> = PathBuf::from("std.jsonnet").into();
self.run_in_state(|| {
self.add_parsed_file(
std_path.clone(),
@@ -381,14 +381,14 @@
/// Raw methods evaluate passed values but don't perform TLA execution
impl EvaluationState {
- pub fn evaluate_file_raw(&self, name: &PathBuf) -> Result<Val> {
+ pub fn evaluate_file_raw(&self, name: &Path) -> Result<Val> {
self.run_in_state(|| self.import_file(&std::env::current_dir().expect("cwd"), name))
}
- pub fn evaluate_file_raw_nocwd(&self, name: &PathBuf) -> Result<Val> {
+ pub fn evaluate_file_raw_nocwd(&self, name: &Path) -> Result<Val> {
self.run_in_state(|| self.import_file(&PathBuf::from("."), name))
}
/// Parses and evaluates the given snippet
- pub fn evaluate_snippet_raw(&self, source: Rc<PathBuf>, code: IStr) -> Result<Val> {
+ pub fn evaluate_snippet_raw(&self, source: Rc<Path>, code: IStr) -> Result<Val> {
let parsed = parse(
&code,
&ParserSettings {
@@ -420,7 +420,7 @@
}
pub fn add_ext_code(&self, name: IStr, code: IStr) -> Result<()> {
let value =
- self.evaluate_snippet_raw(Rc::new(PathBuf::from(format!("ext_code {}", name))), code)?;
+ self.evaluate_snippet_raw(PathBuf::from(format!("ext_code {}", name)).into(), code)?;
self.add_ext_var(name, value);
Ok(())
}
@@ -433,15 +433,15 @@
}
pub fn add_tla_code(&self, name: IStr, code: IStr) -> Result<()> {
let value =
- self.evaluate_snippet_raw(Rc::new(PathBuf::from(format!("tla_code {}", name))), code)?;
+ self.evaluate_snippet_raw(PathBuf::from(format!("tla_code {}", name)).into(), code)?;
self.add_tla(name, value);
Ok(())
}
- pub fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>> {
+ pub fn resolve_file(&self, from: &Path, path: &Path) -> Result<Rc<Path>> {
self.settings().import_resolver.resolve_file(from, path)
}
- pub fn load_file_contents(&self, path: &PathBuf) -> Result<IStr> {
+ pub fn load_file_contents(&self, path: &Path) -> Result<IStr> {
self.settings().import_resolver.load_file_contents(path)
}
@@ -494,7 +494,10 @@
use gc::Gc;
use jrsonnet_interner::IStr;
use jrsonnet_parser::*;
- use std::{path::PathBuf, rc::Rc};
+ use std::{
+ path::{Path, PathBuf},
+ rc::Rc,
+ };
#[test]
#[should_panic]
@@ -503,19 +506,11 @@
state.run_in_state(|| {
state
.push(
- Some(&ExprLocation(
- Rc::new(PathBuf::from("test1.jsonnet")),
- 10,
- 20,
- )),
+ Some(&ExprLocation(PathBuf::from("test1.jsonnet").into(), 10, 20)),
|| "outer".to_owned(),
|| {
state.push(
- Some(&ExprLocation(
- Rc::new(PathBuf::from("test2.jsonnet")),
- 30,
- 40,
- )),
+ Some(&ExprLocation(PathBuf::from("test2.jsonnet").into(), 30, 40)),
|| "inner".to_owned(),
|| Err(RuntimeError("".into()).into()),
)?;
@@ -533,7 +528,7 @@
assert!(primitive_equals(
&state
.evaluate_snippet_raw(
- Rc::new(PathBuf::from("raw.jsonnet")),
+ PathBuf::from("raw.jsonnet").into(),
r#"std.assertEqual(std.base64("test"), "dGVzdA==")"#.into()
)
.unwrap(),
@@ -546,7 +541,7 @@
($str: expr) => {
EvaluationState::default()
.with_stdlib()
- .evaluate_snippet_raw(Rc::new(PathBuf::from("raw.jsonnet")), $str.into())
+ .evaluate_snippet_raw(PathBuf::from("raw.jsonnet").into(), $str.into())
.unwrap()
};
}
@@ -556,7 +551,7 @@
evaluator.with_stdlib();
evaluator.run_in_state(|| {
evaluator
- .evaluate_snippet_raw(Rc::new(PathBuf::from("raw.jsonnet")), $str.into())
+ .evaluate_snippet_raw(PathBuf::from("raw.jsonnet").into(), $str.into())
.unwrap()
.to_json(0)
.unwrap()
@@ -913,7 +908,10 @@
"{:?}",
jrsonnet_parser::parse(
"{ x: 1, y: 2 } == { x: 1, y: 2 }",
- &ParserSettings::default()
+ &ParserSettings {
+ file_name: PathBuf::from("equality").into(),
+ loc_data: true,
+ }
)
);
assert_eval!("{ x: 1, y: 2 } == { x: 1, y: 2 }")
@@ -929,10 +927,10 @@
#[derive(gc::Trace, gc::Finalize)]
struct NativeAdd;
impl NativeCallbackHandler for NativeAdd {
- fn call(&self, from: Option<Rc<PathBuf>>, args: &[Val]) -> crate::error::Result<Val> {
+ fn call(&self, from: Option<Rc<Path>>, args: &[Val]) -> crate::error::Result<Val> {
assert_eq!(
- from.unwrap(),
- Rc::new(PathBuf::from("native_caller.jsonnet"))
+ &from.unwrap() as &Path,
+ &PathBuf::from("native_caller.jsonnet")
);
match (&args[0], &args[1]) {
(Val::Num(a), Val::Num(b)) => Ok(Val::Num(a + b)),
@@ -951,7 +949,7 @@
)),
);
evaluator.evaluate_snippet_raw(
- Rc::new(PathBuf::from("native_caller.jsonnet")),
+ PathBuf::from("native_caller.jsonnet").into(),
"std.assertEqual(std.native(\"native_add\")(1, 2), 3)".into(),
)?;
Ok(())
@@ -1003,11 +1001,11 @@
struct TestImportResolver(IStr);
impl crate::import::ImportResolver for TestImportResolver {
- fn resolve_file(&self, _: &PathBuf, _: &PathBuf) -> crate::error::Result<Rc<PathBuf>> {
- Ok(Rc::new(PathBuf::from("/test")))
+ fn resolve_file(&self, _: &Path, _: &Path) -> crate::error::Result<Rc<Path>> {
+ Ok(PathBuf::from("/test").into())
}
- fn load_file_contents(&self, _: &PathBuf) -> crate::error::Result<IStr> {
+ fn load_file_contents(&self, _: &Path) -> crate::error::Result<IStr> {
Ok(self.0.clone())
}
@@ -1030,7 +1028,7 @@
let error = state
.evaluate_snippet_raw(
- Rc::new(PathBuf::from("issue40.jsonnet")),
+ PathBuf::from("issue40.jsonnet").into(),
r#"
local conf = {
n: ""
crates/jrsonnet-evaluator/src/native.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/native.rs
+++ b/crates/jrsonnet-evaluator/src/native.rs
@@ -4,11 +4,11 @@
use gc::{Finalize, Trace};
use jrsonnet_parser::ParamsDesc;
use std::fmt::Debug;
-use std::path::PathBuf;
+use std::path::Path;
use std::rc::Rc;
pub trait NativeCallbackHandler: Trace {
- fn call(&self, from: Option<Rc<PathBuf>>, args: &[Val]) -> Result<Val>;
+ fn call(&self, from: Option<Rc<Path>>, args: &[Val]) -> Result<Val>;
}
#[derive(Trace, Finalize)]
@@ -20,7 +20,7 @@
pub fn new(params: ParamsDesc, handler: Box<dyn NativeCallbackHandler>) -> Self {
Self { params, handler }
}
- pub fn call(&self, caller: Option<Rc<PathBuf>>, args: &[Val]) -> Result<Val> {
+ pub fn call(&self, caller: Option<Rc<Path>>, args: &[Val]) -> Result<Val> {
self.handler.call(caller, args)
}
}
crates/jrsonnet-evaluator/src/trace/mod.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/trace/mod.rs
+++ b/crates/jrsonnet-evaluator/src/trace/mod.rs
@@ -2,7 +2,7 @@
use crate::{error::Error, EvaluationState, LocError};
pub use location::*;
-use std::path::PathBuf;
+use std::path::{Path, PathBuf};
/// The way paths should be displayed
pub enum PathResolver {
@@ -15,7 +15,7 @@
}
impl PathResolver {
- pub fn resolve(&self, from: &PathBuf) -> String {
+ pub fn resolve(&self, from: &Path) -> String {
match self {
Self::FileName => from.file_name().unwrap().to_string_lossy().into_owned(),
Self::Absolute => from.to_string_lossy().into_owned(),
@@ -255,7 +255,7 @@
&self,
out: &mut dyn std::fmt::Write,
source: &str,
- origin: &PathBuf,
+ origin: &Path,
start: &CodeLocation,
end: &CodeLocation,
desc: &str,
crates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth--- a/crates/jrsonnet-parser/src/expr.rs
+++ b/crates/jrsonnet-parser/src/expr.rs
@@ -7,7 +7,7 @@
use std::{
fmt::{Debug, Display},
ops::Deref,
- path::PathBuf,
+ path::{Path, PathBuf},
rc::Rc,
};
@@ -405,7 +405,7 @@
#[cfg_attr(feature = "serialize", derive(Serialize))]
#[cfg_attr(feature = "deserialize", derive(Deserialize))]
#[derive(Clone, PartialEq)]
-pub struct ExprLocation(pub Rc<PathBuf>, pub usize, pub usize);
+pub struct ExprLocation(pub Rc<Path>, pub usize, pub usize);
impl Finalize for ExprLocation {}
unsafe impl Trace for ExprLocation {
unsafe_empty_trace!();
crates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-parser/src/lib.rs
+++ b/crates/jrsonnet-parser/src/lib.rs
@@ -1,15 +1,17 @@
#![allow(clippy::redundant_closure_call)]
use peg::parser;
-use std::{path::PathBuf, rc::Rc};
+use std::{
+ path::{Path, PathBuf},
+ rc::Rc,
+};
mod expr;
pub use expr::*;
pub use peg;
-#[derive(Default)]
pub struct ParserSettings {
pub loc_data: bool,
- pub file_name: Rc<PathBuf>,
+ pub file_name: Rc<Path>,
}
parser! {
@@ -304,7 +306,6 @@
use super::{expr::*, parse};
use crate::ParserSettings;
use std::path::PathBuf;
- use std::rc::Rc;
macro_rules! parse {
($s:expr) => {
@@ -312,7 +313,7 @@
$s,
&ParserSettings {
loc_data: false,
- file_name: Rc::new(PathBuf::from("/test.jsonnet")),
+ file_name: PathBuf::from("/test.jsonnet").into(),
},
)
.unwrap()