difftreelog
style fix clippy warnings
in: master
19 files changed
Cargo.lockdiffbeforeafterboth154 packageslockfile v3
Might be heavy and slow!
ahash
0.8.11crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011used byaho-corasick
1.1.3crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916depends onallocator-api2
0.2.18crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264fused byannotate-snippets
0.10.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6d9b665789884a7e8fb06c84b295e923b03ca51edbb7d08f91a6a50322ecbfe6depends onanstream
0.6.14crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15bdepends onused byanstyle
1.0.7crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1banstyle-parse
0.2.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4depends onused byanstyle-query
1.0.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5depends onused byanstyle-wincon
3.0.3crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19depends onused byanyhow
1.0.86crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063daautocfg
1.3.0crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0base64
0.22.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6used bybeef
0.5.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1used bybitflags
2.5.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1block-buffer
0.10.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71depends onused bybumpalo
3.16.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012cused bycc
1.0.97crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4cfg-if
1.0.0crates.io↘ 0↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbaf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fdclap
4.5.4crates.io↘ 2↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0depends onclap_builder
4.5.2crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4used byclap_complete
4.5.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275edepends onused byclap_derive
4.5.4crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64used byclap_lex
0.7.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ceused bycolorchoice
1.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422used byconsole
0.15.8crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4ebused bycountme
3.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636used bycpufeatures
0.2.12crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504depends oncrypto-common
0.1.6crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3depends onused byderivative
2.2.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770bdepends ondifflib
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8used bydigest
0.10.7crates.io↘ 2↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292depends ondprint-core
0.65.0crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb569f4e3085ae957ecc37588e6b2227791b72745434eae966db29e122ba27f0dused bydrop_bomb
0.1.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1either
1.12.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58bused byencode_unicode
0.3.6crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831fused byequivalent
1.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5used byerrno
0.3.9crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820badepends onused byfastrand
2.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51aused byfnv
1.0.7crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1used bygeneric-array
0.14.7crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9adepends ongetrandom
0.2.15crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7used byhashbrown
0.12.3crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888used byhashbrown
0.14.5crates.io↘ 2↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1depends onheck
0.5.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55eaused byhi-doc
0.1.1crates.io↘ 5↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd2390a0c9be1370168ef9557833bad3bfa37e1720df61d7f7034f18c07b4e006indexmap
1.9.3crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99depends onused byindexmap
2.2.6crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26used byindoc
2.0.5crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5insta
1.39.0crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5is_terminal_polyfill
1.70.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800used byitertools
0.13.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186depends onused byitoa
1.0.11crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695bused byjrsonnet-cli
0.5.0-pre96workspace↘ 5↖ 1jrsonnet-evaluator
0.5.0-pre96workspace↘ 18↖ 5depends on- annotate-snippets
0.10.2 - anyhow
1.0.86 - derivative
2.2.0 - hashbrown
0.14.5 - hi-doc
0.1.1 - jrsonnet-gcmodule
0.3.7 - jrsonnet-interner
0.5.0-pre96 - jrsonnet-macros
0.5.0-pre96 - jrsonnet-parser
0.5.0-pre96 - jrsonnet-types
0.5.0-pre96 - num-bigint
0.4.5 - pathdiff
0.2.1 - rustc-hash
1.1.0 - serde
1.0.202 - stacker
0.1.15 - static_assertions
1.1.0 - strsim
0.11.1 - thiserror
1.0.61
- annotate-snippets
jrsonnet-fmt
0.5.0-pre96workspace↘ 8↖ 0jrsonnet-gcmodule
0.3.7crates.io↘ 2↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum47975473b24b4503acee0d449fd5eda04ae18828f9811828a6cc99abbbbc38c8jrsonnet-gcmodule-derive
0.3.7crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4782d1d76731f5e5bb4bdeff26ed3350f21d662f178ce6dee7b4da810e7a8f72depends onused byjrsonnet-interner
0.5.0-pre96workspace↘ 3↖ 3jrsonnet-macros
0.5.0-pre96workspace↘ 3↖ 2jrsonnet-parser
0.5.0-pre96workspace↘ 4↖ 5jrsonnet-rowan-parser
0.5.0-pre96workspace↘ 7↖ 1jrsonnet-stdlib
0.5.0-pre96workspace↘ 16↖ 3depends onjrsonnet-types
0.5.0-pre96workspace↘ 2↖ 1depends onjson-structural-diff
0.1.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum25c7940d3c84d2079306c176c7b2b37622b6bc5e43fbd1541b1e4a4e1fd02045depends onused bykeccak
0.1.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654depends onused bylazy_static
1.4.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646libc
0.2.155crates.io↘ 0↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847clibjsonnet
0.5.0-pre96workspace↘ 5↖ 0linked-hash-map
0.5.6crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770fused bylinux-raw-sys
0.4.14crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89used bylock_api
0.4.12crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17depends onused bylogos
0.14.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum161971eb88a0da7ae0c333e1063467c5b5727e7fb6b710b8db4814eade3a42e8depends onlogos-codegen
0.14.0crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8e31badd9de5131fdf4921f6473d457e3dd85b11b7f091ceb50e4df7c3eeb12aused bylogos-derive
0.14.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1c2a69b3eb68d5bd595107c9ee58d7e07fe2bb5e360cc85b0f084dedac80de0adepends onused bylru
0.12.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dcdepends onused bymd5
0.7.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771used bymemchr
2.7.2crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1dmemoffset
0.9.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218adepends onused 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 bynum-bigint
0.4.5crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7num-integer
0.1.46crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858fdepends onused bynum-traits
0.2.19crates.io↘ 1↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841depends ononce_cell
1.19.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92used byparking_lot
0.12.3crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27depends onused byparking_lot_core
0.9.10crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8used bypathdiff
0.2.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44ddpeg
0.8.3crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8a625d12ad770914cbf7eff6f9314c3ef803bfe364a1b20bc36ddf56673e71e5depends onpeg-macros
0.8.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf241d42067ed3ab6a4fece1db720838e1418f36d868585a27931f95d6bc03582used bypeg-runtime
0.8.3crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3aused byppv-lite86
0.2.17crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6deused byproc-macro2
1.0.82crates.io↘ 1↖ 13sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131bdepends onpsm
0.1.21crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874depends onused byquote
1.0.36crates.io↘ 1↖ 12sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7depends onrand
0.8.5crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404used byrand_chacha
0.3.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88depends onused byrand_core
0.6.4crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922cdepends onused byrandom_color
0.8.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0085421bc527effa7ed6d46bac0a28734663c47abe03d80a5e78e441fad85196depends onused byrange-map
0.2.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum12a5a2d6c7039059af621472a4389be1215a816df61aa4d531cfe85264aee95fdepends onused byredox_syscall
0.5.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7edepends onused byregex
1.10.4crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4cregex-automata
0.4.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaeaused byregex-syntax
0.8.3crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumadad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56rowan
0.15.15crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum32a58fa8a7ccff2aec4f39cc45bf5f985cec7125ab271cf681c279fd00192b49rustc-hash
1.1.0crates.io↘ 0↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2rustix
0.38.34crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730fused byryu
1.0.18crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9fscopeguard
1.2.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49used byserde
1.0.202crates.io↘ 1↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395depends onserde_derive
1.0.202crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838depends onused byserde_json
1.0.117crates.io↘ 3↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3depends onserde_yaml_with_quirks
0.8.24crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum47c5983eba86eae2d0058c35fb1065ccffb23af7f8965871069269088098321aused bysha1
0.10.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6badepends onused bysha2
0.10.8crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8depends onused bysha3
0.10.8crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60depends onused bysimilar
2.5.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640used bysmallvec
1.13.2crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67stacker
0.1.15crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fcestatic_assertions
1.1.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543fstrsim
0.11.1crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4fsyn
1.0.109crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237used bysyn
2.0.64crates.io↘ 3↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7ad3dee41f36859875573074334c200d1add8e4a87bb37113ebd31d926b7b11ftempfile
3.10.1crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1used bytests
0.1.0workspace↘ 6↖ 0text-size
1.1.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233used bythiserror
1.0.61crates.io↘ 1↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709depends onthiserror-impl
1.0.61crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533depends onused bytypenum
1.17.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825ungrammar
1.16.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma3e5df347f0bf3ec1d670aad6ca5c6a1859cd9ea61d2113125794654ccced68fused byunicode-ident
1.0.12crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4bunicode-width
0.1.12crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6utf8parse
0.2.1crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370aversion_check
0.9.4crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483fwasi
0.11.0+wasi-snapshot-preview1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423used bywinapi
0.3.9crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419used bywinapi-i686-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6used bywinapi-x86_64-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183fused bywindows_aarch64_gnullvm
0.52.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263used bywindows_aarch64_msvc
0.52.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6used bywindows_i686_gnu
0.52.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670used bywindows_i686_gnullvm
0.52.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9used bywindows_i686_msvc
0.52.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdb3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bfused bywindows_x86_64_gnu
0.52.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9used bywindows_x86_64_gnullvm
0.52.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596used bywindows_x86_64_msvc
0.52.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0used bywindows-sys
0.52.0crates.io↘ 1↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33ddepends onwindows-targets
0.52.5crates.io↘ 8↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7ebdepends onxshell
0.2.6crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6db0ab86eae739efd1b054a8d3d16041914030ac4e01cd1dca0cf252fd8b6437depends onused byxshell-macros
0.2.6crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9d422e8e38ec76e2f06ee439ccc765e9c6a9638b9e7c9f2e8255e4d41e8bd852used byxtask
0.1.0workspace↘ 8↖ 0yaml-rust
0.4.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85depends onused byzerocopy
0.7.34crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087depends onused byzerocopy-derive
0.7.34crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3bdepends onused by
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -89,6 +89,7 @@
lru = "0.12.3"
json-structural-diff = "0.1.0"
+syn-dissect-closure = "0.1.0"
[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "deny"
@@ -107,9 +108,9 @@
all = "warn"
[workspace.lints.clippy]
-all = "warn"
-nursery = "warn"
-pedantic = "warn"
+all = { level = "warn", priority = -1 }
+nursery = { level = "warn", priority = -1 }
+pedantic = { level = "warn", priority = -1 }
ptr_arg = "allow"
# Too verbose
bindings/jsonnet/src/native.rsdiffbeforeafterboth--- a/bindings/jsonnet/src/native.rs
+++ b/bindings/jsonnet/src/native.rs
@@ -20,6 +20,7 @@
/// - `ctx` User pointer, given in `jsonnet_native_callback`.
/// - `argv` Array of arguments from Jsonnet code.
/// - `param` success Set this byref param to 1 to indicate success and 0 for failure.
+///
/// Returns the content of the imported file, or an error message.
type JsonnetNativeCallback = unsafe extern "C" fn(
ctx: *const c_void,
cmds/jrsonnet-fmt/src/comments.rsdiffbeforeafterboth--- a/cmds/jrsonnet-fmt/src/comments.rs
+++ b/cmds/jrsonnet-fmt/src/comments.rs
@@ -20,7 +20,7 @@
let Ok(c) = c else {
let mut text = c.as_ref().unwrap_err() as &str;
while !text.is_empty() {
- let pos = text.find(|c| c == '\n' || c == '\t').unwrap_or(text.len());
+ let pos = text.find(['\n', '\t']).unwrap_or(text.len());
let sliced = &text[..pos];
p!(out, string(sliced.to_string()));
text = &text[pos..];
cmds/jrsonnet-fmt/src/tests.rsdiffbeforeafterboth--- a/cmds/jrsonnet-fmt/src/tests.rs
+++ b/cmds/jrsonnet-fmt/src/tests.rs
@@ -75,5 +75,5 @@
b: '',
},
}"
- )))
+ )));
}
crates/jrsonnet-evaluator/src/function/arglike.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/function/arglike.rs
+++ b/crates/jrsonnet-evaluator/src/function/arglike.rs
@@ -91,6 +91,7 @@
handler: &mut dyn FnMut(&IStr, Thunk<Val>) -> Result<()>,
) -> Result<()>;
fn named_names(&self, handler: &mut dyn FnMut(&IStr));
+ fn is_empty(&self) -> bool;
}
impl ArgsLike for Vec<Val> {
@@ -117,6 +118,9 @@
Ok(())
}
fn named_names(&self, _handler: &mut dyn FnMut(&IStr)) {}
+ fn is_empty(&self) -> bool {
+ self.is_empty()
+ }
}
impl ArgsLike for ArgsDesc {
@@ -173,6 +177,10 @@
handler(name);
}
}
+
+ fn is_empty(&self) -> bool {
+ self.unnamed.is_empty() && self.named.is_empty()
+ }
}
impl<V: ArgLike, S> ArgsLike for HashMap<IStr, V, S> {
@@ -206,6 +214,10 @@
handler(name);
}
}
+
+ fn is_empty(&self) -> bool {
+ self.is_empty()
+ }
}
impl<V, S> OptionalContext for HashMap<IStr, V, S> where V: ArgLike + OptionalContext {}
@@ -235,6 +247,10 @@
fn named_names(&self, handler: &mut dyn FnMut(&IStr)) {
self.0.named_names(handler);
}
+
+ fn is_empty(&self) -> bool {
+ self.0.is_empty()
+ }
}
macro_rules! impl_args_like {
@@ -267,43 +283,13 @@
Ok(())
}
fn named_names(&self, _handler: &mut dyn FnMut(&IStr)) {}
- }
- impl<$($gen: ArgLike,)*> OptionalContext for ($($gen,)*) where $($gen: OptionalContext),* {}
- impl<$($gen: ArgLike,)*> ArgsLike for ($((IStr, $gen),)*) {
- fn unnamed_len(&self) -> usize {
- 0
- }
- fn unnamed_iter(
- &self,
- _ctx: Context,
- _tailstrict: bool,
- _handler: &mut dyn FnMut(usize, Thunk<Val>) -> Result<()>,
- ) -> Result<()> {
- Ok(())
- }
- #[allow(non_snake_case)]
- fn named_iter(
- &self,
- ctx: Context,
- tailstrict: bool,
- handler: &mut dyn FnMut(&IStr, Thunk<Val>) -> Result<()>,
- ) -> Result<()> {
- let ($($gen,)*) = self;
- $(
- handler(&$gen.0, $gen.1.evaluate_arg(ctx.clone(), tailstrict)?)?;
- )*
- Ok(())
- }
- #[allow(non_snake_case)]
- fn named_names(&self, handler: &mut dyn FnMut(&IStr)) {
- let ($($gen,)*) = self;
- $(
- handler(&$gen.0);
- )*
+ fn is_empty(&self) -> bool {
+ // impl_args_like only implements non-empty tuples.
+ false
}
}
- impl<$($gen: ArgLike,)*> OptionalContext for ($((IStr, $gen),)*) where $($gen: OptionalContext),* {}
+ impl<$($gen: ArgLike,)*> OptionalContext for ($($gen,)*) where $($gen: OptionalContext),* {}
};
($count:expr; $($cur:ident)* @ $c:ident $($rest:ident)*) => {
impl_args_like!($count; $($cur)*);
@@ -342,5 +328,8 @@
}
fn named_names(&self, _handler: &mut dyn FnMut(&IStr)) {}
+ fn is_empty(&self) -> bool {
+ true
+ }
}
impl OptionalContext for () {}
crates/jrsonnet-evaluator/src/function/mod.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/function/mod.rs
+++ b/crates/jrsonnet-evaluator/src/function/mod.rs
@@ -12,7 +12,10 @@
native::NativeDesc,
parse::{parse_default_function_call, parse_function_call},
};
-use crate::{evaluate, evaluate_trivial, gc::TraceBox, tb, Context, ContextBuilder, Result, Val};
+use crate::{
+ bail, error::ErrorKind::*, evaluate, evaluate_trivial, gc::TraceBox, tb, Context,
+ ContextBuilder, Result, Thunk, Val,
+};
pub mod arglike;
pub mod builtin;
@@ -94,6 +97,8 @@
Id,
/// Plain function implemented in jsonnet.
Normal(Cc<FuncDesc>),
+ /// Function without arguments works just as a fancy thunk value.
+ Thunk(Thunk<Val>),
/// Standard library function.
StaticBuiltin(#[trace(skip)] &'static dyn StaticBuiltin),
/// User-provided function.
@@ -104,6 +109,7 @@
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Id => f.debug_tuple("Id").finish(),
+ Self::Thunk(arg0) => f.debug_tuple("Thunk").field(arg0).finish(),
Self::Normal(arg0) => f.debug_tuple("Normal").field(arg0).finish(),
Self::StaticBuiltin(arg0) => {
f.debug_tuple("StaticBuiltin").field(&arg0.name()).finish()
@@ -146,6 +152,7 @@
)
})
.collect(),
+ Self::Thunk(_) => vec![],
}
}
/// Amount of non-default required arguments
@@ -155,6 +162,7 @@
Self::Normal(n) => n.params.iter().filter(|p| p.1.is_none()).count(),
Self::StaticBuiltin(i) => i.params().iter().filter(|p| !p.has_default()).count(),
Self::Builtin(i) => i.params().iter().filter(|p| !p.has_default()).count(),
+ Self::Thunk(_) => 0,
}
}
/// Function name, as defined in code.
@@ -164,6 +172,7 @@
Self::Normal(normal) => normal.name.clone(),
Self::StaticBuiltin(builtin) => builtin.name().into(),
Self::Builtin(builtin) => builtin.name().into(),
+ Self::Thunk(_) => "thunk".into(),
}
}
/// Call function using arguments evaluated in specified `call_ctx` [`Context`].
@@ -182,6 +191,12 @@
let body_ctx = func.call_body_context(call_ctx, args, tailstrict)?;
evaluate(body_ctx, &func.body)
}
+ Self::Thunk(thunk) => {
+ if args.is_empty() {
+ bail!(TooManyArgsFunctionHas(0, vec![],))
+ }
+ thunk.evaluate()
+ }
Self::StaticBuiltin(b) => b.call(call_ctx, loc, args),
Self::Builtin(b) => b.call(call_ctx, loc, args),
}
crates/jrsonnet-evaluator/src/stdlib/format.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/stdlib/format.rs
+++ b/crates/jrsonnet-evaluator/src/stdlib/format.rs
@@ -308,22 +308,21 @@
prefix: &str,
caps: bool,
) {
- let radix = radix as f64;
- let iv = iv.floor();
+ let iv = iv.floor() as i64;
// Digit char indexes in reverse order, i.e
// for radix = 16 and n = 12f: [15, 2, 1]
- let digits = if iv == 0.0 {
+ let digits = if iv == 0 {
vec![0u8]
} else {
let mut v = iv.abs();
let mut nums = Vec::with_capacity(1);
- while v != 0.0 {
+ while v != 0 {
nums.push((v % radix) as u8);
- v = (v / radix).floor();
+ v /= radix;
}
nums
};
- let neg = iv < 0.0;
+ let neg = iv < 0;
#[allow(clippy::bool_to_int_with_if)]
let zp = padding.saturating_sub(if neg || blank || sign { 1 } else { 0 });
let zp2 = zp
crates/jrsonnet-rowan-parser/src/ast.rsdiffbeforeafterboth--- a/crates/jrsonnet-rowan-parser/src/ast.rs
+++ b/crates/jrsonnet-rowan-parser/src/ast.rs
@@ -16,12 +16,14 @@
Self: Sized;
fn syntax(&self) -> &SyntaxNode;
+ #[must_use]
fn clone_for_update(&self) -> Self
where
Self: Sized,
{
Self::cast(self.syntax().clone_for_update()).unwrap()
}
+ #[must_use]
fn clone_subtree(&self) -> Self
where
Self: Sized,
@@ -70,6 +72,8 @@
}
pub mod support {
+ use rowan::NodeOrToken;
+
use super::{AstChildren, AstNode, AstToken, SyntaxKind, SyntaxNode, SyntaxToken};
pub fn child<N: AstNode>(parent: &SyntaxNode) -> Option<N> {
@@ -89,7 +93,7 @@
pub fn token(parent: &SyntaxNode, kind: SyntaxKind) -> Option<SyntaxToken> {
parent
.children_with_tokens()
- .filter_map(|it| it.into_token())
+ .filter_map(NodeOrToken::into_token)
.find(|it| it.kind() == kind)
}
}
crates/jrsonnet-rowan-parser/src/event.rsdiffbeforeafterboth--- a/crates/jrsonnet-rowan-parser/src/event.rs
+++ b/crates/jrsonnet-rowan-parser/src/event.rs
@@ -26,7 +26,7 @@
// VirtualToken { kind: SyntaxKind },
/// Position of finished node
Finish {
- /// Same as forward_parent of Start, but for wrapping
+ /// Same as `forward_parent` of Start, but for wrapping
wrapper: Option<NonZeroUsize>,
error: Option<Box<SyntaxError>>,
},
@@ -57,13 +57,14 @@
if self.offset == 0 {
return 0.into();
};
- if let Some(lex) = self.lexemes.get(self.offset) {
- lex.range.start()
- } else if let Some(lex) = self.lexemes.get(self.offset - 1) {
- lex.range.end()
- } else {
- panic!("hard oob")
- }
+ self.lexemes.get(self.offset).map_or_else(
+ || {
+ self.lexemes
+ .get(self.offset - 1)
+ .map_or_else(|| panic!("hard oob"), |lex| lex.range.end())
+ },
+ |lex| lex.range.start(),
+ )
}
pub(super) fn finish(mut self) -> Parse {
@@ -139,7 +140,7 @@
self.errors.push(LocatedSyntaxError {
error: *error,
range: TextRange::new(range.0, range.1),
- })
+ });
}
self.builder.finish_node();
depth -= 1;
@@ -158,7 +159,7 @@
self.errors.push(LocatedSyntaxError {
error: *error,
range: TextRange::new(range.0, range.1),
- })
+ });
}
if depth == 1 {
crates/jrsonnet-stdlib/src/manifest/mod.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/manifest/mod.rs
+++ b/crates/jrsonnet-stdlib/src/manifest/mod.rs
@@ -98,6 +98,7 @@
}
#[builtin]
+#[allow(clippy::fn_params_excessive_bools)]
pub fn builtin_manifest_yaml_stream(
value: Val,
#[default(false)] indent_array_in_object: bool,
crates/jrsonnet-stdlib/src/manifest/yaml.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/manifest/yaml.rs
+++ b/crates/jrsonnet-stdlib/src/manifest/yaml.rs
@@ -76,7 +76,7 @@
string.is_empty()
|| need_quotes_spaces(string)
- || string.starts_with(|c| matches!(c, '&' | '*' | '?' | '|' | '-' | '<' | '>' | '=' | '!' | '%' | '@'))
+ || string.starts_with(['&' , '*' , '?' , '|' , '-' , '<' , '>' , '=' , '!' , '%' , '@'])
|| string.contains(|c| matches!(c, ':' | '{' | '}' | '[' | ']' | ',' | '#' | '`' | '\"' | '\'' | '\\' | '\0'..='\x06' | '\t' | '\n' | '\r' | '\x0e'..='\x1a' | '\x1c'..='\x1f'))
|| [
// http://yaml.org/type/bool.html
crates/jrsonnet-stdlib/src/strings.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/strings.rs
+++ b/crates/jrsonnet-stdlib/src/strings.rs
@@ -267,6 +267,7 @@
}
#[cfg(test)]
+#[allow(clippy::float_cmp)]
mod tests {
use super::*;
@@ -274,8 +275,8 @@
fn parse_nat_base_8() {
assert_eq!(parse_nat::<8>("0").unwrap(), 0.);
assert_eq!(parse_nat::<8>("5").unwrap(), 5.);
- assert_eq!(parse_nat::<8>("32").unwrap(), 0o32 as f64);
- assert_eq!(parse_nat::<8>("761").unwrap(), 0o761 as f64);
+ assert_eq!(parse_nat::<8>("32").unwrap(), f64::from(0o32));
+ assert_eq!(parse_nat::<8>("761").unwrap(), f64::from(0o761));
}
#[test]
@@ -290,7 +291,7 @@
fn parse_nat_base_16() {
assert_eq!(parse_nat::<16>("0").unwrap(), 0.);
assert_eq!(parse_nat::<16>("A").unwrap(), 10.);
- assert_eq!(parse_nat::<16>("a9").unwrap(), 0xA9 as f64);
- assert_eq!(parse_nat::<16>("BbC").unwrap(), 0xBBC as f64);
+ assert_eq!(parse_nat::<16>("a9").unwrap(), f64::from(0xA9));
+ assert_eq!(parse_nat::<16>("BbC").unwrap(), f64::from(0xBBC));
}
}
crates/jrsonnet-types/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-types/src/lib.rs
+++ b/crates/jrsonnet-types/src/lib.rs
@@ -4,84 +4,6 @@
use jrsonnet_gcmodule::Trace;
-#[macro_export]
-macro_rules! ty {
- ((Array<number>)) => {{
- $crate::ComplexValType::ArrayRef(&$crate::ComplexValType::Simple($crate::ValType::Num))
- }};
- ((Array<ubyte>)) => {{
- $crate::ComplexValType::ArrayRef(&$crate::ComplexValType::BoundedNumber(Some(0.0), Some(255.0)))
- }};
- (array) => {
- $crate::ComplexValType::Simple($crate::ValType::Arr)
- };
- (boolean) => {
- $crate::ComplexValType::Simple($crate::ValType::Bool)
- };
- (null) => {
- $crate::ComplexValType::Simple($crate::ValType::Null)
- };
- (string) => {
- $crate::ComplexValType::Simple($crate::ValType::Str)
- };
- (char) => {
- $crate::ComplexValType::Char
- };
- (number) => {
- $crate::ComplexValType::Simple($crate::ValType::Num)
- };
- (BoundedNumber<($min:expr), ($max:expr)>) => {{
- $crate::ComplexValType::BoundedNumber($min, $max)
- }};
- (object) => {
- $crate::ComplexValType::Simple($crate::ValType::Obj)
- };
- (any) => {
- $crate::ComplexValType::Any
- };
- (function) => {
- $crate::ComplexValType::Simple($crate::ValType::Func)
- };
- (($($a:tt) |+)) => {{
- static CONTENTS: &'static [&'static $crate::ComplexValType] = &[
- $(&ty!($a)),+
- ];
- $crate::ComplexValType::UnionRef(CONTENTS)
- }};
- (($($a:tt) &+)) => {{
- static CONTENTS: &'static [&'static $crate::ComplexValType] = &[
- $(&ty!($a)),+
- ];
- $crate::ComplexValType::SumRef(CONTENTS)
- }};
-}
-
-#[test]
-fn test() {
- assert_eq!(
- ty!((Array<number>)),
- ComplexValType::ArrayRef(&ComplexValType::Simple(ValType::Num))
- );
- assert_eq!(ty!(array), ComplexValType::Simple(ValType::Arr));
- assert_eq!(ty!(any), ComplexValType::Any);
- assert_eq!(
- ty!((string | number)),
- ComplexValType::UnionRef(&[
- &ComplexValType::Simple(ValType::Str),
- &ComplexValType::Simple(ValType::Num)
- ])
- );
- assert_eq!(
- format!("{}", ty!(((string & number) | (object & null)))),
- "string & number | object & null"
- );
- assert_eq!(format!("{}", ty!((string | array))), "string | array");
- assert_eq!(
- format!("{}", ty!(((string & number) | array))),
- "string & number | array"
- );
-}
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]
pub enum ValType {
Bool,
@@ -213,98 +135,5 @@
Self::Lazy(lazy) => write!(f, "Lazy<{lazy}>")?,
};
Ok(())
- }
-}
-
-peg::parser! {
-pub grammar parser() for str {
- rule number() -> f64
- = n:$(['0'..='9']+) { n.parse().unwrap() }
-
- rule any_ty() -> ComplexValType = "any" { ComplexValType::Any }
- rule char_ty() -> ComplexValType = "character" { ComplexValType::Char }
- rule bool_ty() -> ComplexValType = "boolean" { ComplexValType::Simple(ValType::Bool) }
- rule null_ty() -> ComplexValType = "null" { ComplexValType::Simple(ValType::Null) }
- rule str_ty() -> ComplexValType = "string" { ComplexValType::Simple(ValType::Str) }
- rule num_ty() -> ComplexValType = "number" { ComplexValType::Simple(ValType::Num) }
- rule simple_array_ty() -> ComplexValType = "array" { ComplexValType::Simple(ValType::Arr) }
- rule simple_object_ty() -> ComplexValType = "object" { ComplexValType::Simple(ValType::Obj) }
- rule simple_function_ty() -> ComplexValType = "function" { ComplexValType::Simple(ValType::Func) }
-
- rule array_ty() -> ComplexValType
- = "Array<" t:ty() ">" { ComplexValType::Array(Box::new(t)) }
-
- rule bounded_number_ty() -> ComplexValType
- = "BoundedNumber<" a:number() ", " b:number() ">" { ComplexValType::BoundedNumber(Some(a), Some(b)) }
-
- rule ty_basic() -> ComplexValType
- = any_ty()
- / char_ty()
- / bool_ty()
- / null_ty()
- / str_ty()
- / num_ty()
- / simple_array_ty()
- / simple_object_ty()
- / simple_function_ty()
- / array_ty()
- / bounded_number_ty()
-
- pub rule ty() -> ComplexValType
- = precedence! {
- a:(@) " | " b:@ {
- match a {
- ComplexValType::Union(mut a) => {
- a.push(b);
- ComplexValType::Union(a)
- }
- _ => ComplexValType::Union(vec![a, b]),
- }
- }
- --
- a:(@) " & " b:@ {
- match a {
- ComplexValType::Sum(mut a) => {
- a.push(b);
- ComplexValType::Sum(a)
- }
- _ => ComplexValType::Sum(vec![a, b]),
- }
- }
- --
- "(" t:ty() ")" { t }
- t:ty_basic() { t }
- }
-}
-}
-
-#[cfg(test)]
-pub mod tests {
- use super::parser;
-
- #[test]
- fn precedence() {
- assert_eq!(
- parser::ty("(any & any) | (any | any) & any")
- .unwrap()
- .to_string(),
- "any & any | (any | any) & any"
- );
- }
-
- #[test]
- fn array() {
- assert_eq!(parser::ty("Array<any>").unwrap().to_string(), "array");
- assert_eq!(
- parser::ty("Array<number>").unwrap().to_string(),
- "Array<number>"
- );
- }
- #[test]
- fn bounded_number() {
- assert_eq!(
- parser::ty("BoundedNumber<1, 2>").unwrap().to_string(),
- "BoundedNumber<1, 2>"
- );
}
}
flake.lockdiffbeforeafterboth--- a/flake.lock
+++ b/flake.lock
@@ -7,11 +7,11 @@
]
},
"locked": {
- "lastModified": 1715274763,
- "narHash": "sha256-3Iv1PGHJn9sV3HO4FlOVaaztOxa9uGLfOmUWrH7v7+A=",
+ "lastModified": 1724377159,
+ "narHash": "sha256-ixjje1JO8ucKT41hs6n2NCde1Vc0+Zc2p2gUbJpCsMw=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "27025ab71bdca30e7ed0a16c88fd74c5970fc7f5",
+ "rev": "3e47b7a86c19142bd3675da49d6acef488b4dac1",
"type": "github"
},
"original": {
@@ -27,44 +27,26 @@
]
},
"locked": {
- "lastModified": 1717285511,
- "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
+ "lastModified": 1722555600,
+ "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci",
"repo": "flake-parts",
- "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
+ "rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
- "type": "github"
- }
- },
- "flake-utils": {
- "inputs": {
- "systems": "systems"
- },
- "locked": {
- "lastModified": 1710146030,
- "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
- "type": "github"
- },
- "original": {
- "owner": "numtide",
- "repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
- "lastModified": 1715551360,
- "narHash": "sha256-fGYt2XnTYUS4Q0eH8tVu3ki1+m9YTgZ+NjlfkMKzko0=",
+ "lastModified": 1724519568,
+ "narHash": "sha256-CmfrenY4cEi/mIslKy8XOGdqxUUVgT6/qMzNcAN/7z8=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "836306cd7bbb9e0f89c557b2ae14df09e573ee89",
+ "rev": "eb0e6df0cdd2641ec0651cd9802ff4cff3b3e915",
"type": "github"
},
"original": {
@@ -84,17 +66,16 @@
},
"rust-overlay": {
"inputs": {
- "flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
- "lastModified": 1715480255,
- "narHash": "sha256-gEZl8nYidQwqJhOigJ91JDjoBFoPEWVsd82AKnaE7Go=",
+ "lastModified": 1724466314,
+ "narHash": "sha256-ltKuK6shQ64uej1mYNtBsDYxttUNFiv9AcHqk0+0NQM=",
"owner": "oxalica",
"repo": "rust-overlay",
- "rev": "d690205a4f01ec0930303c4204e5063958e51255",
+ "rev": "2b5b3edd96ef336b00622dcabc13788fdef9e3ca",
"type": "github"
},
"original": {
@@ -123,21 +104,6 @@
"original": {
"owner": "CertainLach",
"repo": "shelly",
- "type": "github"
- }
- },
- "systems": {
- "locked": {
- "lastModified": 1681028828,
- "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
- "owner": "nix-systems",
- "repo": "default",
- "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
- "type": "github"
- },
- "original": {
- "owner": "nix-systems",
- "repo": "default",
"type": "github"
}
}
rust-toolchain.tomldiffbeforeafterboth--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,3 +1,3 @@
[toolchain]
-channel = "nightly-2024-05-10"
+channel = "nightly-2024-08-20"
components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]
tests/tests/builtin.rsdiffbeforeafterboth--- a/tests/tests/builtin.rs
+++ b/tests/tests/builtin.rs
@@ -11,8 +11,8 @@
use jrsonnet_stdlib::ContextInitializer as StdContextInitializer;
#[builtin]
-fn a() -> Result<u32> {
- Ok(1)
+fn a() -> u32 {
+ 1
}
#[test]
@@ -29,8 +29,8 @@
}
#[builtin]
-fn native_add(a: u32, b: u32) -> Result<u32> {
- Ok(a + b)
+fn native_add(a: u32, b: u32) -> u32 {
+ a + b
}
#[derive(Trace)]
struct NativeAddContextInitializer;
@@ -72,13 +72,13 @@
#[builtin(fields(
a: u32
))]
-fn curried_add(this: &curried_add, b: u32) -> Result<u32> {
- Ok(this.a + b)
+fn curried_add(this: &curried_add, b: u32) -> u32 {
+ this.a + b
}
#[builtin]
-fn curry_add(a: u32) -> Result<FuncVal> {
- Ok(FuncVal::builtin(curried_add { a }))
+fn curry_add(a: u32) -> FuncVal {
+ FuncVal::builtin(curried_add { a })
}
#[derive(Trace)]
struct CurryAddContextInitializer;
tests/tests/common.rsdiffbeforeafterboth--- a/tests/tests/common.rs
+++ b/tests/tests/common.rs
@@ -73,6 +73,7 @@
.iter()
.map(|p| p.name().as_str().unwrap_or("<unnamed>").to_string())
.collect(),
+ FuncVal::Thunk(_) => vec![],
}
}
tests/tests/golden.rsdiffbeforeafterboth--- a/tests/tests/golden.rs
+++ b/tests/tests/golden.rs
@@ -32,7 +32,7 @@
Err(e) => return trace_format.format(&e).unwrap(),
};
match v.manifest(JsonFormat::default()) {
- Ok(v) => v.to_string(),
+ Ok(v) => v,
Err(e) => trace_format.format(&e).unwrap(),
}
}
@@ -57,45 +57,46 @@
if !golden_path.exists() {
fs::write(golden_path, &result)?;
- } else {
- let golden = fs::read_to_string(golden_path)?;
+ continue;
+ }
- match (serde_json::from_str(&result), serde_json::from_str(&golden)) {
- (Err(_), Ok(_)) => assert_eq!(
- result,
- golden,
- "unexpected error for golden {}",
- entry.path().display()
- ),
- (Ok(_), Err(_)) => assert_eq!(
- result,
- golden,
- "expected error for golden {}",
- entry.path().display()
- ),
- (Ok(result), Ok(golden)) => {
- // Show diff relative to golden`.
- let diff = JsonDiff::diff_string(&golden, &result, false);
- if let Some(diff) = diff {
- panic!(
- "Result \n{result:#}\n\
- and golden \n{golden:#}\n\
- did not match structurally:\n{diff:#}\n\
- for golden {}",
- entry.path().display()
- );
- }
- }
- (Err(_), Err(_)) => {}
- };
+ let golden = fs::read_to_string(golden_path)?;
- assert_eq!(
+ match (serde_json::from_str(&result), serde_json::from_str(&golden)) {
+ (Err(_), Ok(_)) => assert_eq!(
result,
golden,
- "golden didn't match for {}",
+ "unexpected error for golden {}",
+ entry.path().display()
+ ),
+ (Ok(_), Err(_)) => assert_eq!(
+ result,
+ golden,
+ "expected error for golden {}",
entry.path().display()
- )
- }
+ ),
+ (Ok(result), Ok(golden)) => {
+ // Show diff relative to golden`.
+ let diff = JsonDiff::diff_string(&golden, &result, false);
+ if let Some(diff) = diff {
+ panic!(
+ "Result \n{result:#}\n\
+ and golden \n{golden:#}\n\
+ did not match structurally:\n{diff:#}\n\
+ for golden {}",
+ entry.path().display()
+ );
+ }
+ }
+ (Err(_), Err(_)) => {}
+ };
+
+ assert_eq!(
+ result,
+ golden,
+ "golden didn't match for {}",
+ entry.path().display()
+ );
}
Ok(())