diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73d2d0e..70af31b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - 'main' + - "main" env: RUSTFLAGS: -D warnings @@ -44,14 +44,14 @@ jobs: run: cargo check --all-targets --all-features - name: "`cargo test`" run: cargo test --no-fail-fast --verbose --locked - clippy: - name: Clippy + analyze: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: rust-toolchain uses: dtolnay/rust-toolchain@stable + - name: "`cargo deny`" + uses: EmbarkStudios/cargo-deny-action@v1 - name: "`cargo clippy`" run: cargo clippy --all-targets --all-features - diff --git a/Cargo.lock b/Cargo.lock index 1e0860c..7c1f152 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.7" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -91,24 +91,24 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" dependencies = [ "backtrace", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -121,21 +121,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "byteorder" @@ -154,9 +148,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -199,12 +193,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" [[package]] name = "cfg-if" @@ -214,21 +205,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.48.5", + "windows-targets 0.52.4", ] [[package]] name = "clap" -version = "4.4.16" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -236,9 +227,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.16" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -248,21 +239,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.57", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -288,33 +279,43 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "enum_dispatch" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.57", +] + +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", ] [[package]] name = "env_logger" -version = "0.10.1" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] @@ -329,9 +330,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "gimli" @@ -341,15 +342,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.3.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "humantime" @@ -359,9 +354,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -380,28 +375,17 @@ dependencies = [ "cc", ] -[[package]] -name = "is-terminal" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" -dependencies = [ - "hermit-abi", - "rustix", - "windows-sys 0.52.0", -] - [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -426,7 +410,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.48", + "syn 2.0.57", ] [[package]] @@ -437,21 +421,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "local-ip-address" -version = "0.5.6" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66357e687a569abca487dc399a9c9ac19beb3f13991ed49f00c144e02cbd42ab" +checksum = "136ef34e18462b17bf39a7826f8f3bbc223341f8e83822beb8b77db9a3d49696" dependencies = [ "libc", "neli", @@ -461,21 +445,21 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -507,9 +491,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -531,9 +515,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -547,20 +531,11 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" -version = "1.10.2" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -570,9 +545,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -581,9 +556,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rustc-demangle" @@ -602,11 +577,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.1", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -615,9 +590,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -630,38 +605,38 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.57", ] [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -670,15 +645,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "suppaftp" -version = "5.3.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca75beb78218d35c14633b468a48f53e90207ee979f71bb486ba7dff06d0436" +checksum = "d9290ef2d57a47ebc32442cbc74ce039e5483e59b6e099a3361346d894b89196" dependencies = [ "chrono", "lazy-regex", @@ -699,9 +674,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" dependencies = [ "proc-macro2", "quote", @@ -716,44 +691,34 @@ checksum = "37c12559dba7383625faaff75be24becf35bfc885044375bcab931111799a3da" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.57", ] [[package]] @@ -770,9 +735,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -780,9 +745,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -790,24 +755,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.57", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -815,22 +780,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.57", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "winapi" @@ -869,7 +834,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -887,7 +852,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -907,17 +872,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -928,9 +893,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -940,9 +905,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -952,9 +917,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -964,9 +929,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -976,9 +941,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -988,9 +953,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -1000,6 +965,6 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" diff --git a/Cargo.toml b/Cargo.toml index ce48838..54877c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ clap = { version = "4.4.2", features = ["derive", "env"] } colored = "2.0.4" either = "1.9.0" enum_dispatch = "0.3.12" -env_logger = "0.10.0" +env_logger = "0.11.3" log = "0.4.20" rustc_version = "0.4.0" serde = { version = "1.0.188", features = ["derive"] } @@ -27,4 +27,11 @@ suppaftp = { version = "5.2.1" } tee = "0.1.0" tempfile = "3.8.0" walkdir = "2.4.0" -local-ip-address = "0.5.6" +local-ip-address = "0.6.1" + +[lints.clippy] +pedantic = { level = "deny", priority = -1 } +module_name_repetitions = "allow" +similar_names = "allow" +unwrap_used = "deny" +expect_used = "deny" diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..954a64c --- /dev/null +++ b/deny.toml @@ -0,0 +1,45 @@ +[graph] +targets = [ + "x86_64-pc-windows-msvc", + "x86_64-apple-darwin", + "x86_64-unknown-linux-gnu", +] +all-features = true +no-default-features = false + +[output] +feature-depth = 1 + +[advisories] +version = 2 +db-path = "~/.cargo/advisory-db" +db-urls = ["https://github.com/rustsec/advisory-db"] +yanked = "deny" + +[licenses] +version = 2 +private = { ignore = true } +allow = ["MIT", "Apache-2.0", "MPL-2.0", "BSD-3-Clause", "Zlib"] +confidence-threshold = 0.9 +exceptions = [{ name = "unicode-ident", allow = ["Unicode-DFS-2016"] }] + +[bans] +multiple-versions = "deny" +wildcards = "deny" +highlight = "simplest-path" +workspace-default-features = "allow" +external-default-features = "allow" +allow-wildcard-paths = true + +skip = [ + { name = "syn", version = "1.0.109", reason = "local-ip-address" }, + { name = "windows-sys", version = "0.48.0", reason = "local-ip-address and colored" }, + { name = "windows_x86_64_msvc", version = "0.48.5", reason = "local-ip-address and colored" }, + { name = "windows_x86_64_gnu", version = "0.48.5", reason = "local-ip-address and colored" }, + { name = "windows-targets", version = "0.48.5", reason = "local-ip-address and colored" }, +] + +[sources] +unknown-registry = "deny" +unknown-git = "deny" +allow-registry = ["https://github.com/rust-lang/crates.io-index"] diff --git a/src/check.rs b/src/check.rs index 0d7d293..f2c8d7a 100644 --- a/src/check.rs +++ b/src/check.rs @@ -8,8 +8,8 @@ use anyhow::{anyhow, Context}; use log::error; use rustc_version::Channel; -pub fn check_rust_version() { - let rust_version = rustc_version::version_meta().unwrap(); +pub fn rust_version() -> anyhow::Result<()> { + let rust_version = rustc_version::version_meta()?; if rust_version.channel > Channel::Nightly { error!( @@ -23,6 +23,8 @@ pub fn check_rust_version() { ); process::exit(1); } + + Ok(()) } pub fn set_cargo_config_env() -> anyhow::Result<()> { diff --git a/src/commands/build.rs b/src/commands/build.rs index dd0d23b..3b6f015 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -6,7 +6,7 @@ use std::{ process::{Command, Stdio}, }; -use crate::ftp; +use crate::{check, ftp}; use anyhow::{bail, Context}; use cargo_metadata::{camino::Utf8PathBuf, Artifact, Message, Package}; use clap::{Args, Subcommand}; @@ -37,7 +37,7 @@ pub struct Build { #[arg(allow_hyphen_values = true)] #[arg(global = true)] #[arg(name = "CARGO_ARGS")] - build_args: Vec, + cargo_args: Vec, } #[derive(Subcommand, Debug)] @@ -131,6 +131,8 @@ impl ExecutableArtifact { impl Executor for Build { fn execute(&self) -> anyhow::Result<()> { + check::rust_version()?; + let ctx = BuildContext::new(self)?; match &self.cmd { @@ -154,7 +156,7 @@ impl Executor for Build { if args.update { let files = ctx.eboot_uploads(&artifacts)?; - ctx.upload(&files, &args.connection.clone().required()?)?; + upload(&files, &args.connection.clone().required()?)?; } if args.run { @@ -188,7 +190,7 @@ impl Executor for Build { } if !upload_files.is_empty() { - ctx.upload(&upload_files, &args.eboot.connection.clone().required()?)?; + upload(&upload_files, &args.eboot.connection.clone().required()?)?; } if args.eboot.run { @@ -240,7 +242,7 @@ impl<'a> BuildContext<'a> { .arg(VITA_TARGET) .arg("--message-format") .arg("json-render-diagnostics") - .args(&self.command.build_args) + .args(&self.command.cargo_args) .stdin(Stdio::inherit()) .stdout(Stdio::piped()) .stderr(Stdio::inherit()); @@ -399,7 +401,7 @@ impl<'a> BuildContext<'a> { let files = WalkDir::new(&assets) .into_iter() - .filter_map(|e| e.ok()) + .filter_map(Result::ok) .filter(|e| e.file_type().is_file()); for file in files { @@ -429,6 +431,7 @@ impl<'a> BuildContext<'a> { Ok(()) } + #[allow(clippy::unused_self)] fn vpk_uploads( &self, artifacts: &[ExecutableArtifact], @@ -472,24 +475,6 @@ impl<'a> BuildContext<'a> { .collect::>>() } - fn upload(&self, files: &[(Utf8PathBuf, String)], conn: &ConnectionArgs) -> anyhow::Result<()> { - if files.is_empty() { - return Ok(()); - } - - let mut ftp = ftp::connect(conn)?; - - for (src, dest) in files { - info!("{} {src} {} {dest}", "Uploading".blue(), "file to".blue()); - - let src = File::open(src).context("Unable to open source file")?; - ftp.put_file(dest, &mut BufReader::new(src)) - .context("Failed to upload file")?; - } - - Ok(()) - } - fn run(&self, artifacts: &[ExecutableArtifact], conn: &ConnectionArgs) -> anyhow::Result<()> { if let Some(art) = artifacts.last() { let title_id = art @@ -511,6 +496,24 @@ impl<'a> BuildContext<'a> { } } +fn upload(files: &[(Utf8PathBuf, String)], conn: &ConnectionArgs) -> anyhow::Result<()> { + if files.is_empty() { + return Ok(()); + } + + let mut ftp = ftp::connect(conn)?; + + for (src, dest) in files { + info!("{} {src} {} {dest}", "Uploading".blue(), "file to".blue()); + + let src = File::open(src).context("Unable to open source file")?; + ftp.put_file(dest, &mut BufReader::new(src)) + .context("Failed to upload file")?; + } + + Ok(()) +} + trait CommandExt { fn pass_env(&mut self, key: K, default: impl Fn() -> V) -> &mut Command where diff --git a/src/commands/coredump.rs b/src/commands/coredump.rs index 1feb179..fdf14fb 100644 --- a/src/commands/coredump.rs +++ b/src/commands/coredump.rs @@ -119,7 +119,7 @@ impl Executor for Coredump { bail!("vita-parse-core failed"); } } else { - warn!("{}", "No coredump files found.".yellow()) + warn!("{}", "No coredump files found.".yellow()); } } CoredumpCmd::Clean(args) => { @@ -135,7 +135,7 @@ impl Executor for Coredump { info!("{}: {file}", "Deleting file".blue()); match ftp.rm(file) { - Ok(_) => {} + Ok(()) => {} Err(FtpError::UnexpectedResponse(e)) if String::from_utf8_lossy(&e.body).contains("226 File deleted") => {} Err(e) => return Err(e).context("Unable to delete file"), @@ -143,7 +143,7 @@ impl Executor for Coredump { } if counter == 0 { - warn!("{}", "No coredump files found.".yellow()) + warn!("{}", "No coredump files found.".yellow()); } } } diff --git a/src/commands/logs.rs b/src/commands/logs.rs index 2904d20..f3cbb71 100644 --- a/src/commands/logs.rs +++ b/src/commands/logs.rs @@ -90,9 +90,10 @@ impl PrincessLogConfig { } fn serialize(&self) -> Vec { - let flags = match self.kernel_debug { - true => NLM_CONFIG_FLAGS_BIT_QAF_DEBUG_PRINTF, - false => 0, + let flags = if self.kernel_debug { + NLM_CONFIG_FLAGS_BIT_QAF_DEBUG_PRINTF + } else { + 0 }; let mut res = Vec::with_capacity(16); @@ -120,18 +121,24 @@ impl Logs { info!("{}", "Found existing config".blue()); match PrincessLogConfig::parse(&mut file) { - Ok(c) => match c.magic == MAGIC { - true => info!( - "{} {ip}:{port} {} {kdbg}", - "Existing config has address".yellow(), - "and kernel debug print is".yellow(), - ip = c.ip, - port = c.port, - kdbg = c.kernel_debug - ), - false => warn!("{}", "Existing config has invalid magic".red()), - }, - Err(err) => warn!("{}: {err}", "Failed to parse existing config".red()), + Ok(c) => { + if c.magic == MAGIC { + info!( + "{} {ip}:{port} {} {kdbg}", + "Existing config has address".yellow(), + "and kernel debug print is".yellow(), + ip = c.ip, + port = c.port, + kdbg = c.kernel_debug + ); + } else { + warn!("{}", "Existing config has invalid magic".red()); + } + } + + Err(err) => { + warn!("{}: {err}", "Failed to parse existing config".red()); + } }; } Err(err) => { @@ -191,7 +198,7 @@ impl Logs { break; } Ok(bytes_read) => { - print!("{}", String::from_utf8_lossy(&buffer[..bytes_read])) + print!("{}", String::from_utf8_lossy(&buffer[..bytes_read])); } Err(e) => { error!("{}: {}", "Error reading from client", e); diff --git a/src/commands/upload.rs b/src/commands/upload.rs index 8c40ed3..4605bf8 100644 --- a/src/commands/upload.rs +++ b/src/commands/upload.rs @@ -60,7 +60,7 @@ impl Executor for Upload { ) .context("Uploading file failed")?; } else if source.is_dir() { - for file in WalkDir::new(source).into_iter().filter_map(|e| e.ok()) { + for file in WalkDir::new(source).into_iter().filter_map(Result::ok) { let source_path = file.path(); let destination = format!( @@ -97,7 +97,7 @@ impl Executor for Upload { if ftp.cwd(&destination).is_err() { info!("{} {destination}", "Creating directory".blue()); match ftp.mkdir(&destination) { - Ok(_) => {} + Ok(()) => {} Err(FtpError::UnexpectedResponse(e)) if String::from_utf8_lossy(&e.body) .starts_with("226 Directory created.") => {} diff --git a/src/ftp.rs b/src/ftp.rs index 64d9b12..954a707 100644 --- a/src/ftp.rs +++ b/src/ftp.rs @@ -1,5 +1,3 @@ -use std::ops::Deref; - use anyhow::Context; use colored::Colorize; use log::info; @@ -8,7 +6,7 @@ use suppaftp::FtpStream; use crate::commands::ConnectionArgs; pub fn connect(conn: &ConnectionArgs) -> anyhow::Result { - let ip = conn.vita_ip.deref(); + let ip = &*conn.vita_ip; let port = conn.ftp_port; info!("{} {ip}:{port}", "Connecting to Vita FTP server".blue()); diff --git a/src/main.rs b/src/main.rs index deb691e..a1611da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,6 @@ mod ftp; mod meta; mod nc; -use check::check_rust_version; use clap::Parser; use colored::Colorize; use commands::{Cargo, Executor}; @@ -26,11 +25,9 @@ fn main() { }) .init(); - check_rust_version(); - let Cargo::Input(input) = Cargo::parse(); match input.cmd.execute() { - Ok(_) => {} + Ok(()) => {} Err(e) => { error!("{}", format!("{e:?}").red()); std::process::exit(1); diff --git a/src/meta.rs b/src/meta.rs index 1287102..6b2b722 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -92,9 +92,9 @@ pub struct PackageMetadata { impl Default for PackageMetadata { fn default() -> Self { Self { - title_id: Default::default(), - title_name: Default::default(), - assets: Default::default(), + title_id: None, + title_name: None, + assets: None, build_std: default_build_std(), vita_strip_flags: default_vita_strip_flags(), vita_make_fself_flags: default_vita_make_fself_flags(), @@ -112,7 +112,7 @@ pub fn parse_crate_metadata( let pkg = match artifact { Some(artifact) => meta.packages.iter().find(|p| p.id == artifact.package_id), - None => meta.workspace_default_packages().first().cloned(), + None => meta.workspace_default_packages().first().copied(), }; if let Some(pkg) = pkg { @@ -126,5 +126,9 @@ pub fn parse_crate_metadata( } } - Ok((Default::default(), pkg.cloned(), meta.target_directory)) + Ok(( + PackageMetadata::default(), + pkg.cloned(), + meta.target_directory, + )) } diff --git a/src/nc.rs b/src/nc.rs index b79e3e2..72167c1 100644 --- a/src/nc.rs +++ b/src/nc.rs @@ -12,7 +12,7 @@ pub fn nc(ip: &str, port: u16, command: &str) -> anyhow::Result<()> { let mut stream = TcpStream::connect((ip, port)).context("Unable to connect to command server")?; - let command = format!("{}\n", command); + let command = format!("{command}\n"); stream .write_all(command.as_bytes()) .context("Unable to write to TCP socket")?;