fix: CI
This commit is contained in:
parent
fb13004b47
commit
b58822319d
339
Cargo.lock
generated
339
Cargo.lock
generated
@ -281,9 +281,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.53"
|
||||
version = "1.2.54"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
|
||||
checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583"
|
||||
dependencies = [
|
||||
"find-msvc-tools",
|
||||
"shlex",
|
||||
@ -318,13 +318,13 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
||||
|
||||
[[package]]
|
||||
name = "chacha20"
|
||||
version = "0.10.0-rc.8"
|
||||
version = "0.10.0-rc.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "31cd65b2ca03198c223cd9a8fa1152c4ec251cd79049f6dc584152ad3fb5ba9d"
|
||||
checksum = "c81d916c6ae06736ec667b51f95ee5ff660a75f4ea6ce1bd932c942365c0ea43"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"rand_core 0.10.0-rc-5",
|
||||
"rand_core 0.10.0-rc-6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -366,18 +366,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.54"
|
||||
version = "4.5.55"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394"
|
||||
checksum = "3e34525d5bbbd55da2bb745d34b36121baac88d07619a9a09cfcf4a6c0832785"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.54"
|
||||
version = "4.5.55"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00"
|
||||
checksum = "59a20016a20a3da95bef50ec7238dbd09baeef4311dcdd38ec15aba69812fb61"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"clap_lex",
|
||||
@ -636,15 +636,14 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
||||
|
||||
[[package]]
|
||||
name = "crossfire"
|
||||
version = "2.1.10"
|
||||
version = "3.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd901251b9b46c1752c85edfee0aee718c03a85a065f4126d32e5d6d419edf48"
|
||||
checksum = "7e1ff29ef3add47897a4dab381889ccf8dedcedec4e2c8feed37efcf22a6392b"
|
||||
dependencies = [
|
||||
"crossbeam-queue",
|
||||
"crossbeam-utils",
|
||||
"enum_dispatch",
|
||||
"futures-core",
|
||||
"parking_lot",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -667,13 +666,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.7.0-rc.21"
|
||||
version = "0.7.0-rc.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9f9a78b88bb8255ec59a81423aa92ada22f96883f9ae59dcb68613907636ae5"
|
||||
checksum = "053c3561863ce55e3226ecc48b08679f4b66cb1b92b9afb42c2c402dfe8b9b51"
|
||||
dependencies = [
|
||||
"ctutils",
|
||||
"num-traits",
|
||||
"rand_core 0.10.0-rc-5",
|
||||
"rand_core 0.10.0-rc-6",
|
||||
"serdect",
|
||||
"zeroize",
|
||||
]
|
||||
@ -699,13 +698,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crypto-primes"
|
||||
version = "0.7.0-pre.7"
|
||||
version = "0.7.0-pre.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c6372ba15f988d7cd77e9cfbc42b269601c006f2f16a21a72b886136caf04bfb"
|
||||
checksum = "334a79c97c0b7fa536716dc132fd417d0afbf471440a41fc25a5d9f66d8771cd"
|
||||
dependencies = [
|
||||
"crypto-bigint 0.7.0-rc.21",
|
||||
"crypto-bigint 0.7.0-rc.22",
|
||||
"libm",
|
||||
"rand_core 0.10.0-rc-5",
|
||||
"rand_core 0.10.0-rc-6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -776,9 +775,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.11.0-rc.8"
|
||||
version = "0.11.0-rc.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2fc1408b7a9f59a7b933faff3e9e7fc15a05a524effd3b3d1601156944c8077f"
|
||||
checksum = "bff8de092798697546237a3a701e4174fe021579faec9b854379af9bf1e31962"
|
||||
dependencies = [
|
||||
"block-buffer 0.11.0",
|
||||
"const-oid 0.10.2",
|
||||
@ -959,6 +958,12 @@ version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
||||
|
||||
[[package]]
|
||||
name = "foldhash"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
||||
|
||||
[[package]]
|
||||
name = "foldhash"
|
||||
version = "0.2.0"
|
||||
@ -1099,15 +1104,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.4.0-rc.0"
|
||||
version = "0.4.0-rc.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3b99f0d993a2b9b97b9a201193aa8ad21305cde06a3be9a7e1f8f4201e5cc27e"
|
||||
checksum = "74f70a332ddf75e5e5e43284304179ba02f391f82f692f030b08a8378adf3c99"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"r-efi",
|
||||
"rand_core 0.10.0-rc-5",
|
||||
"rand_core 0.10.0-rc-6",
|
||||
"wasip2",
|
||||
"wasip3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1157,6 +1163,15 @@ version = "0.14.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.15.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
||||
dependencies = [
|
||||
"foldhash 0.1.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.16.1"
|
||||
@ -1165,7 +1180,7 @@ checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
||||
dependencies = [
|
||||
"allocator-api2",
|
||||
"equivalent",
|
||||
"foldhash",
|
||||
"foldhash 0.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1213,11 +1228,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hmac"
|
||||
version = "0.13.0-rc.3"
|
||||
version = "0.13.0-rc.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1c597ac7d6cc8143e30e83ef70915e7f883b18d8bec2e2b2bce47f5bbb06d57"
|
||||
checksum = "d9956e202a691c5c86c60303a421f66f93f44b29433407b7c43cf2bebadc750e"
|
||||
dependencies = [
|
||||
"digest 0.11.0-rc.8",
|
||||
"digest 0.11.0-rc.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1282,9 +1297,9 @@ checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424"
|
||||
|
||||
[[package]]
|
||||
name = "hybrid-array"
|
||||
version = "0.4.5"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f471e0a81b2f90ffc0cb2f951ae04da57de8baa46fa99112b062a5173a5088d0"
|
||||
checksum = "b41fb3dc24fe72c2e3a4685eed55917c2fb228851257f4a8f2d985da9443c3e5"
|
||||
dependencies = [
|
||||
"typenum",
|
||||
]
|
||||
@ -1427,6 +1442,12 @@ dependencies = [
|
||||
"zerovec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "id-arena"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "1.1.0"
|
||||
@ -1539,6 +1560,12 @@ version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "leb128fmt"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.180"
|
||||
@ -1557,9 +1584,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libm"
|
||||
version = "0.2.15"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
|
||||
checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
@ -1723,9 +1750,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "num-conv"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
|
||||
checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
|
||||
|
||||
[[package]]
|
||||
name = "num-derive"
|
||||
@ -2002,9 +2029,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.11.0-rc.9"
|
||||
version = "0.11.0-rc.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "80f8fa6196ede5a9f9ee95b44ca134bddc9b70e8913f9297bd58c909f5889a09"
|
||||
checksum = "b226d2cc389763951db8869584fd800cbbe2962bf454e2edeb5172b31ee99774"
|
||||
dependencies = [
|
||||
"der 0.8.0-rc.10",
|
||||
"spki 0.8.0-rc.4",
|
||||
@ -2040,6 +2067,16 @@ version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
||||
|
||||
[[package]]
|
||||
name = "prettyplease"
|
||||
version = "0.2.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "primeorder"
|
||||
version = "0.13.6"
|
||||
@ -2121,13 +2158,14 @@ dependencies = [
|
||||
"bytes",
|
||||
"console-subscriber",
|
||||
"crossbeam",
|
||||
"dashmap",
|
||||
"flate2",
|
||||
"futures",
|
||||
"hmac 0.13.0-rc.3",
|
||||
"hmac 0.13.0-rc.4",
|
||||
"libloading",
|
||||
"log",
|
||||
"num-bigint",
|
||||
"pkcs8 0.11.0-rc.9",
|
||||
"pkcs8 0.11.0-rc.10",
|
||||
"pumpkin-config",
|
||||
"pumpkin-data",
|
||||
"pumpkin-inventory",
|
||||
@ -2347,12 +2385,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.10.0-rc.7"
|
||||
source = "git+https://github.com/rust-random/rand#7a81944044f3f1d2dc5c85a8ca9bd30429f46bd0"
|
||||
version = "0.10.0-rc.8"
|
||||
source = "git+https://github.com/rust-random/rand#47455a0b004d5992d2a3d23ecf244f1edea27f40"
|
||||
dependencies = [
|
||||
"chacha20",
|
||||
"getrandom 0.4.0-rc.0",
|
||||
"rand_core 0.10.0-rc-5",
|
||||
"getrandom 0.4.0-rc.1",
|
||||
"rand_core 0.10.0-rc-6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2366,9 +2404,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.10.0-rc-5"
|
||||
version = "0.10.0-rc-6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "05a06e03bd1f2ae861ab9e7498b6c64ed3dadb9ce175c0464a2522a5f23c0045"
|
||||
checksum = "70765ff7112b0fb2d272d24d9a2f907fc206211304328fe58b2db15a5649ef28"
|
||||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
@ -2454,19 +2492,19 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rsa"
|
||||
version = "0.10.0-rc.13"
|
||||
version = "0.10.0-rc.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ff85dd219e338d42a2eada54ad71fe515717e08d53f728a8803de33b83f80b8"
|
||||
checksum = "6ef381dd6f207f81aff2ee3a8264eddd68ba475bbfcdb44ca445e5906bce381b"
|
||||
dependencies = [
|
||||
"const-oid 0.10.2",
|
||||
"crypto-bigint 0.7.0-rc.21",
|
||||
"crypto-bigint 0.7.0-rc.22",
|
||||
"crypto-primes",
|
||||
"digest 0.11.0-rc.8",
|
||||
"digest 0.11.0-rc.9",
|
||||
"pkcs1",
|
||||
"pkcs8 0.11.0-rc.9",
|
||||
"rand_core 0.10.0-rc-5",
|
||||
"pkcs8 0.11.0-rc.10",
|
||||
"rand_core 0.10.0-rc-6",
|
||||
"sha1",
|
||||
"signature 3.0.0-rc.8",
|
||||
"signature 3.0.0-rc.9",
|
||||
"spki 0.8.0-rc.4",
|
||||
"zeroize",
|
||||
]
|
||||
@ -2591,6 +2629,12 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.228"
|
||||
@ -2672,7 +2716,7 @@ checksum = "9c777f0a122a53fddb0beb6e706771197000b8eb5c9f42b5b850f450ef48c788"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.11.0-rc.8",
|
||||
"digest 0.11.0-rc.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2694,7 +2738,7 @@ checksum = "7535f94fa3339fe9e5e9be6260a909e62af97f6e14b32345ccf79b92b8b81233"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest 0.11.0-rc.8",
|
||||
"digest 0.11.0-rc.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2734,12 +2778,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "3.0.0-rc.8"
|
||||
version = "3.0.0-rc.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c04b70a14ee5f15e2e0c785a5fdb2e9a51138dfe13ba3cf8eab037a9e60b1879"
|
||||
checksum = "0ad0ce3b3f8efd7406f22e2ca5d02be21cdf3b3d1d53ab141f784de8965c7c7e"
|
||||
dependencies = [
|
||||
"digest 0.11.0-rc.8",
|
||||
"rand_core 0.10.0-rc-5",
|
||||
"digest 0.11.0-rc.9",
|
||||
"rand_core 0.10.0-rc-6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2762,9 +2806,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
|
||||
checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
@ -2789,9 +2833,9 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.6.1"
|
||||
version = "0.6.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
|
||||
checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.60.2",
|
||||
@ -2904,18 +2948,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "2.0.17"
|
||||
version = "2.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
|
||||
checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "2.0.17"
|
||||
version = "2.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
|
||||
checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2933,9 +2977,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.45"
|
||||
version = "0.3.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd"
|
||||
checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5"
|
||||
dependencies = [
|
||||
"deranged",
|
||||
"itoa",
|
||||
@ -2950,15 +2994,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time-core"
|
||||
version = "0.1.7"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca"
|
||||
checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
|
||||
|
||||
[[package]]
|
||||
name = "time-macros"
|
||||
version = "0.2.25"
|
||||
version = "0.2.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd"
|
||||
checksum = "78cc610bac2dcee56805c99642447d4c5dbde4d01f752ffea0199aee1f601dc4"
|
||||
dependencies = [
|
||||
"num-conv",
|
||||
"time-core",
|
||||
@ -3242,6 +3286,12 @@ version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
|
||||
|
||||
[[package]]
|
||||
name = "untrusted"
|
||||
version = "0.9.0"
|
||||
@ -3366,7 +3416,16 @@ version = "1.0.2+wasi-0.2.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
|
||||
dependencies = [
|
||||
"wit-bindgen",
|
||||
"wit-bindgen 0.51.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasip3"
|
||||
version = "0.3.1+wasi-0.3.0-rc-2025-09-16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "87ba4be47b1d11244670d11857eee0758a8f2c39aea64d80b78c1ce29b4642cd"
|
||||
dependencies = [
|
||||
"wit-bindgen 0.48.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3414,6 +3473,40 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-encoder"
|
||||
version = "0.241.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e01164c9dda68301e34fdae536c23ed6fe90ce6d97213ccc171eebbd3d02d6b8"
|
||||
dependencies = [
|
||||
"leb128fmt",
|
||||
"wasmparser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-metadata"
|
||||
version = "0.241.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "876fe286f2fa416386deedebe8407e6f19e0b5aeaef3d03161e77a15fa80f167"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"indexmap",
|
||||
"wasm-encoder",
|
||||
"wasmparser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmparser"
|
||||
version = "0.241.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46d90019b1afd4b808c263e428de644f3003691f243387d30d673211ee0cb8e8"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"hashbrown 0.15.5",
|
||||
"indexmap",
|
||||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "1.0.5"
|
||||
@ -3631,12 +3724,100 @@ version = "0.7.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
|
||||
|
||||
[[package]]
|
||||
name = "wit-bindgen"
|
||||
version = "0.48.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f8c2adb5f74ac9395bc3121c99a1254bf9310482c27b13f97167aedb5887138"
|
||||
dependencies = [
|
||||
"wit-bindgen-rust-macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wit-bindgen"
|
||||
version = "0.51.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
|
||||
|
||||
[[package]]
|
||||
name = "wit-bindgen-core"
|
||||
version = "0.48.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b881a098cae03686d7a0587f8f306f8a58102ad8da8b5599100fbe0e7f5800b"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"heck",
|
||||
"wit-parser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wit-bindgen-rust"
|
||||
version = "0.48.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "69667efa439a453e1d50dac939c6cab6d2c3ac724a9d232b6631dad2472a5b70"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"heck",
|
||||
"indexmap",
|
||||
"prettyplease",
|
||||
"syn",
|
||||
"wasm-metadata",
|
||||
"wit-bindgen-core",
|
||||
"wit-component",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wit-bindgen-rust-macro"
|
||||
version = "0.48.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eae2e22cceb5d105d52326c07e3e67603a861cc7add70fc467f7cc7ec5265017"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"prettyplease",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"wit-bindgen-core",
|
||||
"wit-bindgen-rust",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wit-component"
|
||||
version = "0.241.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fd0c57df25e7ee612d946d3b7646c1ddb2310f8280aa2c17e543b66e0812241"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bitflags",
|
||||
"indexmap",
|
||||
"log",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"wasm-encoder",
|
||||
"wasm-metadata",
|
||||
"wasmparser",
|
||||
"wit-parser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wit-parser"
|
||||
version = "0.241.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ef1c6ad67f35c831abd4039c02894de97034100899614d1c44e2268ad01c91"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"id-arena",
|
||||
"indexmap",
|
||||
"log",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"unicode-xid",
|
||||
"wasmparser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "writeable"
|
||||
version = "0.6.2"
|
||||
@ -3668,18 +3849,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.33"
|
||||
version = "0.8.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
|
||||
checksum = "fdea86ddd5568519879b8187e1cf04e24fce28f7fe046ceecbce472ff19a2572"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.33"
|
||||
version = "0.8.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
|
||||
checksum = "0c15e1b46eff7c6c91195752e0eeed8ef040e391cdece7c25376957d5f15df22"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -3748,6 +3929,6 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zmij"
|
||||
version = "1.0.14"
|
||||
version = "1.0.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea"
|
||||
checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439"
|
||||
|
||||
19
Cargo.toml
19
Cargo.toml
@ -16,7 +16,7 @@ members = [
|
||||
[workspace.lints.clippy]
|
||||
# Groups
|
||||
all = { level = "deny", priority = -1 }
|
||||
# nursery = { level = "deny", priority = -1 }
|
||||
nursery = { level = "deny", priority = -1 }
|
||||
pedantic = { level = "deny", priority = -1 }
|
||||
cargo = { level = "deny", priority = -1 }
|
||||
|
||||
@ -25,6 +25,7 @@ empty_enum_variants_with_brackets = "deny"
|
||||
empty_structs_with_brackets = "deny"
|
||||
separated_literal_suffix = "deny"
|
||||
semicolon_outside_block = "deny"
|
||||
redundant_test_prefix = "deny"
|
||||
non_zero_suggestions = "deny"
|
||||
string_lit_chars_any = "deny"
|
||||
use_self = "deny"
|
||||
@ -46,7 +47,15 @@ cast_precision_loss = "allow"
|
||||
multiple_crate_versions = "allow"
|
||||
single_call_fn = "allow"
|
||||
unreadable_literal = "allow"
|
||||
many_single_char_names = "allow"
|
||||
suboptimal_flops = "allow"
|
||||
cast_lossless = "allow"
|
||||
while_float = "allow"
|
||||
or_fun_call = "allow"
|
||||
significant_drop_tightening = "allow"
|
||||
suspicious_operation_groupings = "allow"
|
||||
literal_string_with_formatting_args = "allow"
|
||||
future_not_send = "allow"
|
||||
cast_sign_loss = "allow"
|
||||
float_cmp = "allow"
|
||||
cast_possible_truncation = "allow"
|
||||
@ -106,14 +115,14 @@ console-subscriber = { version = "0.5.0", default-features = false }
|
||||
crc-fast = "1.10.0"
|
||||
criterion = { version = "0.8", default-features = false }
|
||||
crossbeam-utils = "0.8.21"
|
||||
crossfire = "2.1.10"
|
||||
crossfire = { version= "3.0.2", features = ["compat"]}
|
||||
dashmap = "6.1"
|
||||
ecdsa = "0.16.9"
|
||||
enum_dispatch = "0.3.13"
|
||||
env_logger = "0.11.8"
|
||||
flate2 = "1.1.8"
|
||||
heck = "0.5"
|
||||
hmac = "=0.13.0-rc.3"
|
||||
hmac = "=0.13.0-rc.4"
|
||||
indexmap = "2.13"
|
||||
itertools = "0.14.0"
|
||||
libloading = "0.9"
|
||||
@ -126,7 +135,7 @@ num-traits = "0.2"
|
||||
num_cpus = "1.17.0"
|
||||
p384 = "0.13.1"
|
||||
phf = "0.13.1"
|
||||
pkcs8 = "=0.11.0-rc.9"
|
||||
pkcs8 = "=0.11.0-rc.10"
|
||||
proc-macro2 = "1.0"
|
||||
pumpkin-config = { path = "pumpkin-config" }
|
||||
pumpkin-data = { path = "pumpkin-data" }
|
||||
@ -138,7 +147,7 @@ pumpkin-util = { path = "pumpkin-util" }
|
||||
pumpkin-world = { path = "pumpkin-world" }
|
||||
quote = "1.0"
|
||||
rand = { git = "https://github.com/rust-random/rand"}
|
||||
rsa = "=0.10.0-rc.13"
|
||||
rsa = "=0.10.0-rc.14"
|
||||
rustc-hash = "2.1.1"
|
||||
rustyline = "17.0.2"
|
||||
ruzstd = "0.8.2"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use pumpkin_util::ProfileAction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
#[serde(default)]
|
||||
pub struct AuthenticationConfig {
|
||||
/// Whether to use Mojang authentication.
|
||||
@ -35,7 +35,7 @@ impl Default for AuthenticationConfig {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
#[serde(default)]
|
||||
pub struct PlayerProfileConfig {
|
||||
/// Allow players flagged by Mojang (e.g. banned, forced name change).
|
||||
@ -56,7 +56,7 @@ impl Default for PlayerProfileConfig {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
#[serde(default)]
|
||||
pub struct TextureConfig {
|
||||
/// Whether to use player textures.
|
||||
@ -80,7 +80,7 @@ impl Default for TextureConfig {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
#[serde(default)]
|
||||
pub struct TextureTypes {
|
||||
/// Use player skins.
|
||||
|
||||
@ -12,7 +12,7 @@ pub struct Op {
|
||||
|
||||
impl Op {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
uuid: Uuid,
|
||||
name: String,
|
||||
level: PermissionLvl,
|
||||
|
||||
@ -9,7 +9,7 @@ pub struct WhitelistEntry {
|
||||
|
||||
impl WhitelistEntry {
|
||||
#[must_use]
|
||||
pub fn new(uuid: Uuid, name: String) -> Self {
|
||||
pub const fn new(uuid: Uuid, name: String) -> Self {
|
||||
Self { uuid, name }
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ fn get_i32_hash(val: i32) -> u32 {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hash() {
|
||||
fn hash() {
|
||||
assert_eq!(get_str_hash("minecraft:sharpness"), 2734053906u32);
|
||||
assert_eq!(get_i32_hash(3), 3795317917u32);
|
||||
assert_eq!(
|
||||
|
||||
@ -145,7 +145,7 @@ pub enum DropType {
|
||||
}
|
||||
|
||||
impl DropType {
|
||||
fn from_i8(value: i8) -> Result<Self, InventoryError> {
|
||||
const fn from_i8(value: i8) -> Result<Self, InventoryError> {
|
||||
Ok(match value {
|
||||
0 => Self::SingleItem,
|
||||
1 => Self::FullStack,
|
||||
@ -154,13 +154,13 @@ impl DropType {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum MouseDragType {
|
||||
Left,
|
||||
Right,
|
||||
Middle,
|
||||
}
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
pub enum MouseDragState {
|
||||
Start(MouseDragType),
|
||||
AddSlot(usize),
|
||||
|
||||
@ -73,7 +73,7 @@ impl PlayerInventory {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn is_valid_hotbar_index(slot: usize) -> bool {
|
||||
pub const fn is_valid_hotbar_index(slot: usize) -> bool {
|
||||
slot < Self::HOTBAR_SIZE
|
||||
}
|
||||
|
||||
|
||||
@ -210,7 +210,7 @@ pub trait Slot: Send + Sync {
|
||||
self.on_take_item(player, stack).await;
|
||||
}
|
||||
|
||||
stack.unwrap_or(ItemStack::EMPTY.clone())
|
||||
stack.unwrap_or_else(|| ItemStack::EMPTY.clone())
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ pub struct WindowProperty<T: WindowPropertyTrait> {
|
||||
}
|
||||
|
||||
impl<T: WindowPropertyTrait> WindowProperty<T> {
|
||||
pub fn new(window_property: T, value: i16) -> Self {
|
||||
pub const fn new(window_property: T, value: i16) -> Self {
|
||||
Self {
|
||||
window_property,
|
||||
value,
|
||||
|
||||
@ -21,7 +21,7 @@ pub struct NbtCompound {
|
||||
|
||||
impl NbtCompound {
|
||||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
pub const fn new() -> Self {
|
||||
Self {
|
||||
child_tags: Vec::new(),
|
||||
}
|
||||
@ -85,7 +85,7 @@ impl NbtCompound {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn is_empty(&self) -> bool {
|
||||
pub const fn is_empty(&self) -> bool {
|
||||
self.child_tags.is_empty()
|
||||
}
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ pub struct NbtReadHelper<R: Read + Seek> {
|
||||
}
|
||||
|
||||
impl<R: Read + Seek> NbtReadHelper<R> {
|
||||
pub fn new(r: R) -> Self {
|
||||
pub const fn new(r: R) -> Self {
|
||||
Self { reader: r }
|
||||
}
|
||||
}
|
||||
@ -87,7 +87,7 @@ pub struct Deserializer<R: Read + Seek> {
|
||||
}
|
||||
|
||||
impl<R: Read + Seek> Deserializer<R> {
|
||||
pub fn new(input: R, is_named: bool) -> Self {
|
||||
pub const fn new(input: R, is_named: bool) -> Self {
|
||||
Self {
|
||||
input: NbtReadHelper { reader: input },
|
||||
tag_to_deserialize_stack: None,
|
||||
|
||||
@ -77,7 +77,7 @@ pub struct Nbt {
|
||||
|
||||
impl Nbt {
|
||||
#[must_use]
|
||||
pub fn new(name: String, tag: NbtCompound) -> Self {
|
||||
pub const fn new(name: String, tag: NbtCompound) -> Self {
|
||||
Self {
|
||||
name,
|
||||
root_tag: tag,
|
||||
@ -231,7 +231,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_simple_ser_de_unnamed() {
|
||||
fn simple_ser_de_unnamed() {
|
||||
let test = Test {
|
||||
byte: 123,
|
||||
short: 1342,
|
||||
@ -260,7 +260,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_simple_ser_de_array() {
|
||||
fn simple_ser_de_array() {
|
||||
let test = TestArray {
|
||||
byte_array: vec![0, 3, 2],
|
||||
int_array: vec![13, 1321, 2],
|
||||
@ -275,7 +275,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_simple_ser_de_named() {
|
||||
fn simple_ser_de_named() {
|
||||
let name = String::from("Test");
|
||||
let test = Test {
|
||||
byte: 123,
|
||||
@ -294,7 +294,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_simple_ser_de_array_named() {
|
||||
fn simple_ser_de_array_named() {
|
||||
let name = String::from("Test");
|
||||
let test = TestArray {
|
||||
byte_array: vec![0, 3, 2],
|
||||
@ -329,7 +329,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_list() {
|
||||
fn list() {
|
||||
let test1 = Test {
|
||||
byte: 123,
|
||||
short: 1342,
|
||||
@ -369,7 +369,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_list_named() {
|
||||
fn list_named() {
|
||||
let test1 = Test {
|
||||
byte: 123,
|
||||
short: 1342,
|
||||
@ -407,7 +407,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_nbt_arrays() {
|
||||
fn nbt_arrays() {
|
||||
#[derive(Serialize)]
|
||||
struct Tagged {
|
||||
#[serde(serialize_with = "nbt_long_array")]
|
||||
@ -489,7 +489,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tuple_fail() {
|
||||
fn tuple_fail() {
|
||||
#[derive(Serialize)]
|
||||
struct BadData {
|
||||
x: (i32, i64),
|
||||
@ -506,7 +506,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tuple_ok() {
|
||||
fn tuple_ok() {
|
||||
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
||||
struct GoodData {
|
||||
x: (i32, i32),
|
||||
|
||||
@ -116,7 +116,7 @@ mod tests {
|
||||
use std::io::Cursor;
|
||||
|
||||
#[test]
|
||||
fn test_gzip_read_write_compound() {
|
||||
fn gzip_read_write_compound() {
|
||||
// Create a test compound
|
||||
let mut compound = NbtCompound::new();
|
||||
compound.put_byte("byte_value", 123);
|
||||
@ -163,7 +163,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_gzip_convenience_methods() {
|
||||
fn gzip_convenience_methods() {
|
||||
// Create a test compound
|
||||
let mut compound = NbtCompound::new();
|
||||
compound.put_int("test_value", 12345);
|
||||
@ -180,7 +180,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_gzip_empty_compound() {
|
||||
fn gzip_empty_compound() {
|
||||
let compound = NbtCompound::new();
|
||||
let mut buffer = Vec::new();
|
||||
write_gzip_compound_tag(compound, &mut buffer).expect("Failed to compress empty compound");
|
||||
@ -191,7 +191,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_gzip_large_compound() {
|
||||
fn gzip_large_compound() {
|
||||
let mut compound = NbtCompound::new();
|
||||
|
||||
// Add 1000 integer entries
|
||||
@ -229,7 +229,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_gzip_serialize_deserialize() {
|
||||
fn gzip_serialize_deserialize() {
|
||||
let test_struct = TestStruct {
|
||||
string_field: "test string".to_string(),
|
||||
int_field: 12345,
|
||||
@ -263,7 +263,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
#[expect(clippy::print_stdout)]
|
||||
fn test_gzip_compression_ratio() {
|
||||
fn gzip_compression_ratio() {
|
||||
let mut compound = NbtCompound::new();
|
||||
|
||||
// Create a compound with repetitive data (should compress well)
|
||||
@ -287,7 +287,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_gzip_invalid_data() {
|
||||
fn gzip_invalid_data() {
|
||||
// Try to read from invalid data
|
||||
let invalid_data = vec![1, 2, 3, 4, 5]; // Not valid GZip data
|
||||
let result = read_gzip_compound_tag(Cursor::new(invalid_data));
|
||||
@ -296,7 +296,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
#[expect(clippy::struct_field_names)]
|
||||
fn test_roundtrip_with_arrays() {
|
||||
fn roundtrip_with_arrays() {
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
||||
struct ArrayTest {
|
||||
byte_array: Vec<u8>,
|
||||
@ -319,7 +319,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_roundtrip_with_map() {
|
||||
fn roundtrip_with_map() {
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
||||
struct MapTest {
|
||||
string_map: HashMap<String, String>,
|
||||
@ -348,7 +348,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_direct_file_io() {
|
||||
fn direct_file_io() {
|
||||
use tempfile::tempdir;
|
||||
|
||||
let temp_dir = tempdir().expect("Failed to create temporary directory");
|
||||
|
||||
@ -16,7 +16,7 @@ pub struct WriteAdaptor<W: Write> {
|
||||
}
|
||||
|
||||
impl<W: Write> WriteAdaptor<W> {
|
||||
pub fn new(w: W) -> Self {
|
||||
pub const fn new(w: W) -> Self {
|
||||
Self { writer: w }
|
||||
}
|
||||
}
|
||||
@ -57,7 +57,7 @@ pub struct Serializer<W: Write> {
|
||||
}
|
||||
|
||||
impl<W: Write> Serializer<W> {
|
||||
pub fn new(output: W, name: Option<String>) -> Self {
|
||||
pub const fn new(output: W, name: Option<String>) -> Self {
|
||||
Self {
|
||||
output: WriteAdaptor::new(output),
|
||||
state: State::Root(name),
|
||||
|
||||
@ -267,7 +267,7 @@ impl NbtTag {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn extract_byte(&self) -> Option<i8> {
|
||||
pub const fn extract_byte(&self) -> Option<i8> {
|
||||
match self {
|
||||
Self::Byte(byte) => Some(*byte),
|
||||
_ => None,
|
||||
@ -275,7 +275,7 @@ impl NbtTag {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn extract_short(&self) -> Option<i16> {
|
||||
pub const fn extract_short(&self) -> Option<i16> {
|
||||
match self {
|
||||
Self::Short(short) => Some(*short),
|
||||
_ => None,
|
||||
@ -283,7 +283,7 @@ impl NbtTag {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn extract_int(&self) -> Option<i32> {
|
||||
pub const fn extract_int(&self) -> Option<i32> {
|
||||
match self {
|
||||
Self::Int(int) => Some(*int),
|
||||
_ => None,
|
||||
@ -291,7 +291,7 @@ impl NbtTag {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn extract_long(&self) -> Option<i64> {
|
||||
pub const fn extract_long(&self) -> Option<i64> {
|
||||
match self {
|
||||
Self::Long(long) => Some(*long),
|
||||
_ => None,
|
||||
@ -299,7 +299,7 @@ impl NbtTag {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn extract_float(&self) -> Option<f32> {
|
||||
pub const fn extract_float(&self) -> Option<f32> {
|
||||
match self {
|
||||
Self::Float(float) => Some(*float),
|
||||
_ => None,
|
||||
@ -307,7 +307,7 @@ impl NbtTag {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn extract_double(&self) -> Option<f64> {
|
||||
pub const fn extract_double(&self) -> Option<f64> {
|
||||
match self {
|
||||
Self::Double(double) => Some(*double),
|
||||
_ => None,
|
||||
@ -347,7 +347,7 @@ impl NbtTag {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn extract_compound(&self) -> Option<&NbtCompound> {
|
||||
pub const fn extract_compound(&self) -> Option<&NbtCompound> {
|
||||
match self {
|
||||
Self::Compound(compound) => Some(compound),
|
||||
_ => None,
|
||||
|
||||
@ -16,7 +16,7 @@ pub struct Ack {
|
||||
|
||||
impl Ack {
|
||||
#[must_use]
|
||||
pub fn new(sequences: Vec<u32>) -> Self {
|
||||
pub const fn new(sequences: Vec<u32>) -> Self {
|
||||
Self { sequences }
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ pub struct CDisconnectPlayer {
|
||||
|
||||
impl CDisconnectPlayer {
|
||||
#[must_use]
|
||||
pub fn new(reason: i32, message: String) -> Self {
|
||||
pub const fn new(reason: i32, message: String) -> Self {
|
||||
Self {
|
||||
reason: VarInt(reason),
|
||||
skip_message: message.is_empty(),
|
||||
|
||||
@ -9,7 +9,7 @@ pub struct CHandshake {
|
||||
|
||||
impl CHandshake {
|
||||
#[must_use]
|
||||
pub fn new(jwt_data: String) -> Self {
|
||||
pub const fn new(jwt_data: String) -> Self {
|
||||
Self { jwt_data }
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ pub struct CNetworkChunkPublisherUpdate {
|
||||
|
||||
impl CNetworkChunkPublisherUpdate {
|
||||
#[must_use]
|
||||
pub fn new(pos_for_view: BlockPos, new_radius: u32) -> Self {
|
||||
pub const fn new(pos_for_view: BlockPos, new_radius: u32) -> Self {
|
||||
Self {
|
||||
pos_for_view: NetworkPos(pos_for_view),
|
||||
new_radius: VarUInt(new_radius),
|
||||
|
||||
@ -14,7 +14,7 @@ pub struct CNetworkSettings {
|
||||
|
||||
impl CNetworkSettings {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
compression_threshold: u16,
|
||||
compression_method: u16,
|
||||
client_throttle_enabled: bool,
|
||||
|
||||
@ -13,7 +13,7 @@ pub struct CConnectedPong {
|
||||
impl CConnectedPong {
|
||||
#[must_use]
|
||||
#[expect(clippy::similar_names)]
|
||||
pub fn new(ping: u64, pong: u64) -> Self {
|
||||
pub const fn new(ping: u64, pong: u64) -> Self {
|
||||
Self { ping, pong }
|
||||
}
|
||||
}
|
||||
@ -30,7 +30,7 @@ pub struct CConnectionRequestAccepted {
|
||||
|
||||
impl CConnectionRequestAccepted {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
client_address: SocketAddr,
|
||||
system_index: u16,
|
||||
system_addresses: [SocketAddr; 10],
|
||||
|
||||
@ -17,7 +17,7 @@ pub struct COpenConnectionReply1 {
|
||||
|
||||
impl COpenConnectionReply1 {
|
||||
#[must_use]
|
||||
pub fn new(server_guid: u64, has_server_security: bool, mtu: u16) -> Self {
|
||||
pub const fn new(server_guid: u64, has_server_security: bool, mtu: u16) -> Self {
|
||||
Self {
|
||||
magic: RAKNET_MAGIC,
|
||||
server_guid,
|
||||
@ -40,7 +40,12 @@ pub struct COpenConnectionReply2 {
|
||||
|
||||
impl COpenConnectionReply2 {
|
||||
#[must_use]
|
||||
pub fn new(server_guid: u64, client_address: SocketAddr, mtu: u16, security: bool) -> Self {
|
||||
pub const fn new(
|
||||
server_guid: u64,
|
||||
client_address: SocketAddr,
|
||||
mtu: u16,
|
||||
security: bool,
|
||||
) -> Self {
|
||||
Self {
|
||||
magic: RAKNET_MAGIC,
|
||||
server_guid,
|
||||
|
||||
@ -62,7 +62,7 @@ impl fmt::Display for ServerInfo {
|
||||
|
||||
impl CUnconnectedPong {
|
||||
#[must_use]
|
||||
pub fn new(time: u64, server_guid: u64, magic: [u8; 16], server_id: String) -> Self {
|
||||
pub const fn new(time: u64, server_guid: u64, magic: [u8; 16], server_id: String) -> Self {
|
||||
Self {
|
||||
time,
|
||||
server_guid,
|
||||
|
||||
@ -18,7 +18,7 @@ pub struct CResourcePackStackPacket {
|
||||
|
||||
impl CResourcePackStackPacket {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
resource_pack_required: bool,
|
||||
texture_pack_list_size: VarUInt,
|
||||
game_version: String,
|
||||
|
||||
@ -17,7 +17,7 @@ pub struct CResourcePacksInfo {
|
||||
impl CResourcePacksInfo {
|
||||
#[must_use]
|
||||
#[expect(clippy::fn_params_excessive_bools)]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
resource_pack_required: bool,
|
||||
has_addon_packs: bool,
|
||||
has_scripts: bool,
|
||||
|
||||
@ -72,7 +72,7 @@ pub enum MetadataValue {
|
||||
|
||||
impl MetadataValue {
|
||||
#[must_use]
|
||||
pub fn type_id(&self) -> u32 {
|
||||
pub const fn type_id(&self) -> u32 {
|
||||
match self {
|
||||
Self::Byte(_) => 0,
|
||||
Self::Short(_) => 1,
|
||||
|
||||
@ -52,7 +52,7 @@ pub struct Frame {
|
||||
|
||||
impl Frame {
|
||||
#[must_use]
|
||||
pub fn new_unreliable(payload: Vec<u8>) -> Self {
|
||||
pub const fn new_unreliable(payload: Vec<u8>) -> Self {
|
||||
Self {
|
||||
reliability: RakReliability::Unreliable,
|
||||
payload,
|
||||
|
||||
@ -36,7 +36,7 @@ pub enum RakReliability {
|
||||
|
||||
impl RakReliability {
|
||||
#[must_use]
|
||||
pub fn is_reliable(&self) -> bool {
|
||||
pub const fn is_reliable(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
Self::Reliable
|
||||
@ -48,12 +48,12 @@ impl RakReliability {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn is_sequenced(&self) -> bool {
|
||||
pub const fn is_sequenced(&self) -> bool {
|
||||
matches!(self, Self::ReliableSequenced | Self::UnreliableSequenced)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn is_ordered(&self) -> bool {
|
||||
pub const fn is_ordered(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
Self::UnreliableSequenced
|
||||
@ -64,7 +64,7 @@ impl RakReliability {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn is_order_exclusive(&self) -> bool {
|
||||
pub const fn is_order_exclusive(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
Self::ReliableOrdered | Self::ReliableOrderedWithAckReceipt
|
||||
@ -72,7 +72,7 @@ impl RakReliability {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn from_id(id: u8) -> Option<Self> {
|
||||
pub const fn from_id(id: u8) -> Option<Self> {
|
||||
match id {
|
||||
0 => Some(Self::Unreliable),
|
||||
1 => Some(Self::UnreliableSequenced),
|
||||
@ -87,7 +87,7 @@ impl RakReliability {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn to_id(&self) -> u8 {
|
||||
pub const fn to_id(&self) -> u8 {
|
||||
match self {
|
||||
Self::Unreliable => 0,
|
||||
Self::UnreliableSequenced => 1,
|
||||
|
||||
@ -90,16 +90,16 @@ impl Default for UDPNetworkDecoder {
|
||||
|
||||
impl UDPNetworkDecoder {
|
||||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
pub const fn new() -> Self {
|
||||
Self { compression: None }
|
||||
}
|
||||
|
||||
pub fn set_compression(&mut self, threshold: CompressionThreshold) {
|
||||
pub const fn set_compression(&mut self, threshold: CompressionThreshold) {
|
||||
self.compression = Some(threshold);
|
||||
}
|
||||
|
||||
/// NOTE: Encryption can only be set; a minecraft stream cannot go back to being unencrypted
|
||||
pub fn set_encryption(&mut self, _key: &[u8; 16]) {
|
||||
pub const fn set_encryption(&mut self, _key: &[u8; 16]) {
|
||||
// if matches!(self.reader, DecryptionReader::Decrypt(_)) {
|
||||
// panic!("Cannot upgrade a stream that already has a cipher!");
|
||||
// }
|
||||
|
||||
@ -91,16 +91,19 @@ impl Default for UDPNetworkEncoder {
|
||||
|
||||
impl UDPNetworkEncoder {
|
||||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
pub const fn new() -> Self {
|
||||
Self { compression: None }
|
||||
}
|
||||
|
||||
pub fn set_compression(&mut self, compression_info: (CompressionThreshold, CompressionLevel)) {
|
||||
pub const fn set_compression(
|
||||
&mut self,
|
||||
compression_info: (CompressionThreshold, CompressionLevel),
|
||||
) {
|
||||
self.compression = Some(compression_info);
|
||||
}
|
||||
|
||||
/// NOTE: Encryption can only be set; a minecraft stream cannot go back to being unencrypted
|
||||
pub fn set_encryption(&mut self, _key: &[u8; 16]) {
|
||||
pub const fn set_encryption(&mut self, _key: &[u8; 16]) {
|
||||
// if matches!(self.writer, EncryptionWriter::Encrypt(_)) {
|
||||
// panic!("Cannot upgrade a stream that already has a cipher!");
|
||||
// }
|
||||
|
||||
@ -14,7 +14,7 @@ pub struct SLoadingScreen {
|
||||
|
||||
impl SLoadingScreen {
|
||||
#[must_use]
|
||||
pub fn is_loading_done(&self) -> bool {
|
||||
pub const fn is_loading_done(&self) -> bool {
|
||||
self.status.0 == 2
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ impl SText {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_dummy_strings(category: u8) -> &'static [&'static str] {
|
||||
const fn get_dummy_strings(category: u8) -> &'static [&'static str] {
|
||||
match category {
|
||||
0 => &[
|
||||
"raw",
|
||||
@ -71,7 +71,7 @@ impl SText {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_category(&self) -> u8 {
|
||||
const fn get_category(&self) -> u8 {
|
||||
match self.r#type {
|
||||
TextPacketType::Raw
|
||||
| TextPacketType::Tip
|
||||
@ -205,7 +205,7 @@ impl PacketWrite for SText {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[repr(u8)]
|
||||
pub enum TextPacketType {
|
||||
Raw = 0,
|
||||
|
||||
@ -31,7 +31,7 @@ impl VarInt {
|
||||
/// Returns the exact number of bytes this `VarInt` will write when
|
||||
/// [`Encode::encode`] is called, assuming no error occurs.
|
||||
#[must_use]
|
||||
pub fn written_size(&self) -> usize {
|
||||
pub const fn written_size(&self) -> usize {
|
||||
match self.0 {
|
||||
0 => 1,
|
||||
n => (31 - n.leading_zeros() as usize) / 7 + 1,
|
||||
|
||||
@ -30,7 +30,7 @@ impl VarULong {
|
||||
/// Returns the exact number of bytes this `VarLong` will write when
|
||||
/// [`Encode::encode`] is called, assuming no error occurs.
|
||||
#[must_use]
|
||||
pub fn written_size(&self) -> usize {
|
||||
pub const fn written_size(&self) -> usize {
|
||||
match self.0 {
|
||||
0 => 1,
|
||||
n => (31 - n.leading_zeros() as usize) / 7 + 1,
|
||||
|
||||
@ -71,12 +71,12 @@ fn clamp_value(value: f64) -> f64 {
|
||||
value.clamp(-MAX_VELOCITY_CLAMP, MAX_VELOCITY_CLAMP)
|
||||
}
|
||||
|
||||
fn abs_max(a: f64, b: f64) -> f64 {
|
||||
const fn abs_max(a: f64, b: f64) -> f64 {
|
||||
a.abs().max(b.abs())
|
||||
}
|
||||
|
||||
fn to_long(value: f64) -> i64 {
|
||||
(((value * 0.5 + 0.5) * MAX_15_BIT_VALUE).round() as i64).clamp(0, 32766)
|
||||
((value.mul_add(0.5, 0.5) * MAX_15_BIT_VALUE).round() as i64).clamp(0, 32766)
|
||||
}
|
||||
|
||||
impl Serialize for Velocity {
|
||||
|
||||
@ -18,7 +18,7 @@ pub struct CConfigAddResourcePack<'a> {
|
||||
|
||||
impl<'a> CConfigAddResourcePack<'a> {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
uuid: &'a uuid::Uuid,
|
||||
url: &'a str,
|
||||
hash: &'a str,
|
||||
|
||||
@ -10,7 +10,7 @@ pub struct CConfigDisconnect<'a> {
|
||||
|
||||
impl<'a> CConfigDisconnect<'a> {
|
||||
#[must_use]
|
||||
pub fn new(reason: &'a str) -> Self {
|
||||
pub const fn new(reason: &'a str) -> Self {
|
||||
Self { reason }
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ pub struct CCookieRequest<'a> {
|
||||
|
||||
impl<'a> CCookieRequest<'a> {
|
||||
#[must_use]
|
||||
pub fn new(key: &'a ResourceLocation) -> Self {
|
||||
pub const fn new(key: &'a ResourceLocation) -> Self {
|
||||
Self { key }
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ pub struct CKnownPacks<'a> {
|
||||
|
||||
impl<'a> CKnownPacks<'a> {
|
||||
#[must_use]
|
||||
pub fn new(known_packs: &'a [KnownPack]) -> Self {
|
||||
pub const fn new(known_packs: &'a [KnownPack]) -> Self {
|
||||
Self { known_packs }
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ pub struct CPluginMessage<'a> {
|
||||
|
||||
impl<'a> CPluginMessage<'a> {
|
||||
#[must_use]
|
||||
pub fn new(channel: &'a str, data: &'a [u8]) -> Self {
|
||||
pub const fn new(channel: &'a str, data: &'a [u8]) -> Self {
|
||||
Self { channel, data }
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ pub struct CRegistryData<'a> {
|
||||
|
||||
impl<'a> CRegistryData<'a> {
|
||||
#[must_use]
|
||||
pub fn new(registry_id: &'a ResourceLocation, entries: &'a [RegistryEntry]) -> Self {
|
||||
pub const fn new(registry_id: &'a ResourceLocation, entries: &'a [RegistryEntry]) -> Self {
|
||||
Self {
|
||||
registry_id,
|
||||
entries,
|
||||
@ -31,7 +31,7 @@ pub struct RegistryEntry {
|
||||
// TODO: No unwraps
|
||||
impl RegistryEntry {
|
||||
#[must_use]
|
||||
pub fn new(entry_id: ResourceLocation, data: Option<Box<[u8]>>) -> Self {
|
||||
pub const fn new(entry_id: ResourceLocation, data: Option<Box<[u8]>>) -> Self {
|
||||
Self { entry_id, data }
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ pub struct CConfigServerLinks<'a> {
|
||||
|
||||
impl<'a> CConfigServerLinks<'a> {
|
||||
#[must_use]
|
||||
pub fn new(links: &'a [Link<'a>]) -> Self {
|
||||
pub const fn new(links: &'a [Link<'a>]) -> Self {
|
||||
Self { links }
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ pub struct CStoreCookie<'a> {
|
||||
|
||||
impl<'a> CStoreCookie<'a> {
|
||||
#[must_use]
|
||||
pub fn new(key: &'a ResourceLocation, payload: &'a [u8]) -> Self {
|
||||
pub const fn new(key: &'a ResourceLocation, payload: &'a [u8]) -> Self {
|
||||
Self { key, payload }
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ pub struct CTransfer<'a> {
|
||||
|
||||
impl<'a> CTransfer<'a> {
|
||||
#[must_use]
|
||||
pub fn new(host: &'a str, port: &'a VarInt) -> Self {
|
||||
pub const fn new(host: &'a str, port: &'a VarInt) -> Self {
|
||||
Self { host, port }
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ pub struct CUpdateTags<'a> {
|
||||
|
||||
impl<'a> CUpdateTags<'a> {
|
||||
#[must_use]
|
||||
pub fn new(tags: &'a [RegistryKey]) -> Self {
|
||||
pub const fn new(tags: &'a [RegistryKey]) -> Self {
|
||||
Self { tags }
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ pub struct CLoginCookieRequest<'a> {
|
||||
|
||||
impl<'a> CLoginCookieRequest<'a> {
|
||||
#[must_use]
|
||||
pub fn new(key: &'a ResourceLocation) -> Self {
|
||||
pub const fn new(key: &'a ResourceLocation) -> Self {
|
||||
Self { key }
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ pub struct CEncryptionRequest<'a> {
|
||||
|
||||
impl<'a> CEncryptionRequest<'a> {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
server_id: &'a str,
|
||||
public_key: &'a [u8],
|
||||
verify_token: &'a [u8],
|
||||
|
||||
@ -15,7 +15,7 @@ pub struct CLoginDisconnect {
|
||||
|
||||
impl CLoginDisconnect {
|
||||
#[must_use]
|
||||
pub fn new(json_reason: String) -> Self {
|
||||
pub const fn new(json_reason: String) -> Self {
|
||||
Self { json_reason }
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ pub struct CLoginSuccess<'a> {
|
||||
|
||||
impl<'a> CLoginSuccess<'a> {
|
||||
#[must_use]
|
||||
pub fn new(uuid: &'a uuid::Uuid, username: &'a str, properties: &'a [Property]) -> Self {
|
||||
pub const fn new(uuid: &'a uuid::Uuid, username: &'a str, properties: &'a [Property]) -> Self {
|
||||
Self {
|
||||
uuid,
|
||||
username,
|
||||
|
||||
@ -24,7 +24,7 @@ pub struct CLoginPluginRequest<'a> {
|
||||
|
||||
impl<'a> CLoginPluginRequest<'a> {
|
||||
#[must_use]
|
||||
pub fn new(message_id: VarInt, channel: &'a str, data: &'a [u8]) -> Self {
|
||||
pub const fn new(message_id: VarInt, channel: &'a str, data: &'a [u8]) -> Self {
|
||||
Self {
|
||||
message_id,
|
||||
channel,
|
||||
|
||||
@ -20,7 +20,7 @@ pub struct CSetCompression {
|
||||
|
||||
impl CSetCompression {
|
||||
#[must_use]
|
||||
pub fn new(threshold: VarInt) -> Self {
|
||||
pub const fn new(threshold: VarInt) -> Self {
|
||||
Self { threshold }
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ pub struct CAcknowledgeBlockChange {
|
||||
|
||||
impl CAcknowledgeBlockChange {
|
||||
#[must_use]
|
||||
pub fn new(sequence_id: VarInt) -> Self {
|
||||
pub const fn new(sequence_id: VarInt) -> Self {
|
||||
Self { sequence_id }
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ pub struct CActionBar<'a> {
|
||||
|
||||
impl<'a> CActionBar<'a> {
|
||||
#[must_use]
|
||||
pub fn new(action_bar: &'a TextComponent) -> Self {
|
||||
pub const fn new(action_bar: &'a TextComponent) -> Self {
|
||||
Self { action_bar }
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ pub struct CSetBlockDestroyStage {
|
||||
|
||||
impl CSetBlockDestroyStage {
|
||||
#[must_use]
|
||||
pub fn new(entity_id: VarInt, location: BlockPos, destroy_stage: i8) -> Self {
|
||||
pub const fn new(entity_id: VarInt, location: BlockPos, destroy_stage: i8) -> Self {
|
||||
Self {
|
||||
entity_id,
|
||||
location,
|
||||
|
||||
@ -23,7 +23,7 @@ pub struct CBlockEntityData {
|
||||
|
||||
impl CBlockEntityData {
|
||||
#[must_use]
|
||||
pub fn new(location: BlockPos, r#type: VarInt, nbt_data: Box<[u8]>) -> Self {
|
||||
pub const fn new(location: BlockPos, r#type: VarInt, nbt_data: Box<[u8]>) -> Self {
|
||||
Self {
|
||||
location,
|
||||
r#type,
|
||||
|
||||
@ -26,7 +26,7 @@ pub struct CBlockEvent {
|
||||
|
||||
impl CBlockEvent {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
location: BlockPos,
|
||||
action_id: u8,
|
||||
action_parameter: u8,
|
||||
|
||||
@ -21,7 +21,7 @@ pub struct CBlockUpdate {
|
||||
|
||||
impl CBlockUpdate {
|
||||
#[must_use]
|
||||
pub fn new(location: BlockPos, state_id: VarInt) -> Self {
|
||||
pub const fn new(location: BlockPos, state_id: VarInt) -> Self {
|
||||
Self { location, state_id }
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ pub struct CBossEvent<'a> {
|
||||
|
||||
impl<'a> CBossEvent<'a> {
|
||||
#[must_use]
|
||||
pub fn new(uuid: &'a uuid::Uuid, action: BosseventAction) -> Self {
|
||||
pub const fn new(uuid: &'a uuid::Uuid, action: BosseventAction) -> Self {
|
||||
Self { uuid, action }
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ pub struct CChangeDifficulty {
|
||||
|
||||
impl CChangeDifficulty {
|
||||
#[must_use]
|
||||
pub fn new(difficulty: u8, locked: bool) -> Self {
|
||||
pub const fn new(difficulty: u8, locked: bool) -> Self {
|
||||
Self { difficulty, locked }
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ pub struct CCombatDeath<'a> {
|
||||
|
||||
impl<'a> CCombatDeath<'a> {
|
||||
#[must_use]
|
||||
pub fn new(player_id: VarInt, message: &'a TextComponent) -> Self {
|
||||
pub const fn new(player_id: VarInt, message: &'a TextComponent) -> Self {
|
||||
Self { player_id, message }
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ pub struct CCommandSuggestions {
|
||||
|
||||
impl CCommandSuggestions {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
id: VarInt,
|
||||
start: VarInt,
|
||||
length: VarInt,
|
||||
@ -52,7 +52,7 @@ pub struct CommandSuggestion {
|
||||
|
||||
impl CommandSuggestion {
|
||||
#[must_use]
|
||||
pub fn new(suggestion: String, tooltip: Option<TextComponent>) -> Self {
|
||||
pub const fn new(suggestion: String, tooltip: Option<TextComponent>) -> Self {
|
||||
Self {
|
||||
suggestion,
|
||||
tooltip,
|
||||
|
||||
@ -23,7 +23,7 @@ pub struct CCommands<'a> {
|
||||
|
||||
impl<'a> CCommands<'a> {
|
||||
#[must_use]
|
||||
pub fn new(nodes: Box<[ProtoNode<'a>]>, root_node_index: VarInt) -> Self {
|
||||
pub const fn new(nodes: Box<[ProtoNode<'a>]>, root_node_index: VarInt) -> Self {
|
||||
Self {
|
||||
nodes,
|
||||
root_node_index,
|
||||
@ -331,7 +331,7 @@ pub enum SuggestionProviders {
|
||||
}
|
||||
|
||||
impl SuggestionProviders {
|
||||
fn resource_location(self) -> &'static str {
|
||||
const fn resource_location(self) -> &'static str {
|
||||
match self {
|
||||
Self::AskServer => "minecraft:ask_server",
|
||||
Self::AllRecipes => "minecraft:all_recipes",
|
||||
|
||||
@ -17,7 +17,7 @@ pub struct CPlayCookieRequest<'a> {
|
||||
|
||||
impl<'a> CPlayCookieRequest<'a> {
|
||||
#[must_use]
|
||||
pub fn new(key: &'a ResourceLocation) -> Self {
|
||||
pub const fn new(key: &'a ResourceLocation) -> Self {
|
||||
Self { key }
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ pub struct CPlayDisconnect<'a> {
|
||||
|
||||
impl<'a> CPlayDisconnect<'a> {
|
||||
#[must_use]
|
||||
pub fn new(reason: &'a TextComponent) -> Self {
|
||||
pub const fn new(reason: &'a TextComponent) -> Self {
|
||||
Self { reason }
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ pub struct CDisguisedChatMessage<'a> {
|
||||
|
||||
impl<'a> CDisguisedChatMessage<'a> {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
message: &'a TextComponent,
|
||||
chat_type: VarInt,
|
||||
sender_name: &'a TextComponent,
|
||||
|
||||
@ -23,7 +23,7 @@ pub struct CDisplayObjective {
|
||||
|
||||
impl CDisplayObjective {
|
||||
#[must_use]
|
||||
pub fn new(position: ScoreboardDisplaySlot, score_name: String) -> Self {
|
||||
pub const fn new(position: ScoreboardDisplaySlot, score_name: String) -> Self {
|
||||
Self {
|
||||
position: VarInt(position as i32),
|
||||
score_name,
|
||||
|
||||
@ -20,7 +20,7 @@ pub struct CEntityAnimation {
|
||||
|
||||
impl CEntityAnimation {
|
||||
#[must_use]
|
||||
pub fn new(entity_id: VarInt, animation: Animation) -> Self {
|
||||
pub const fn new(entity_id: VarInt, animation: Animation) -> Self {
|
||||
Self {
|
||||
entity_id,
|
||||
animation: animation as u8,
|
||||
|
||||
@ -28,7 +28,7 @@ pub struct CSetEntityMetadata {
|
||||
|
||||
impl CSetEntityMetadata {
|
||||
#[must_use]
|
||||
pub fn new(entity_id: VarInt, metadata: Box<[u8]>) -> Self {
|
||||
pub const fn new(entity_id: VarInt, metadata: Box<[u8]>) -> Self {
|
||||
Self {
|
||||
entity_id,
|
||||
metadata,
|
||||
@ -43,7 +43,7 @@ pub struct Metadata<T> {
|
||||
}
|
||||
|
||||
impl<T> Metadata<T> {
|
||||
pub fn new(index: TrackedId, r#type: MetaDataType, value: T) -> Self {
|
||||
pub const fn new(index: TrackedId, r#type: MetaDataType, value: T) -> Self {
|
||||
Self {
|
||||
index,
|
||||
r#type: VarInt(r#type as i32),
|
||||
|
||||
@ -33,7 +33,7 @@ pub struct CEntityPositionSync {
|
||||
|
||||
impl CEntityPositionSync {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
entity_id: VarInt,
|
||||
position: Vector3<f64>,
|
||||
delta: Vector3<f64>,
|
||||
|
||||
@ -31,7 +31,7 @@ pub struct CEntitySoundEffect {
|
||||
|
||||
impl CEntitySoundEffect {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
sound_event: IdOr<SoundEvent>,
|
||||
sound_category: SoundCategory,
|
||||
entity_id: VarInt,
|
||||
|
||||
@ -20,7 +20,7 @@ pub struct CEntityStatus {
|
||||
|
||||
impl CEntityStatus {
|
||||
#[must_use]
|
||||
pub fn new(entity_id: i32, entity_status: i8) -> Self {
|
||||
pub const fn new(entity_id: i32, entity_status: i8) -> Self {
|
||||
Self {
|
||||
entity_id,
|
||||
entity_status,
|
||||
|
||||
@ -20,7 +20,7 @@ pub struct CEntityVelocity {
|
||||
|
||||
impl CEntityVelocity {
|
||||
#[must_use]
|
||||
pub fn new(entity_id: VarInt, velocity: Vector3<f64>) -> Self {
|
||||
pub const fn new(entity_id: VarInt, velocity: Vector3<f64>) -> Self {
|
||||
Self {
|
||||
entity_id,
|
||||
velocity: Velocity(velocity),
|
||||
|
||||
@ -35,7 +35,7 @@ pub struct CExplosion {
|
||||
|
||||
impl CExplosion {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
center: Vector3<f64>,
|
||||
radius: f32,
|
||||
block_count: i32,
|
||||
|
||||
@ -19,7 +19,7 @@ pub struct CGameEvent {
|
||||
/// You need to implement all the random stuff somewhere, right?
|
||||
impl CGameEvent {
|
||||
#[must_use]
|
||||
pub fn new(event: GameEvent, value: f32) -> Self {
|
||||
pub const fn new(event: GameEvent, value: f32) -> Self {
|
||||
Self {
|
||||
event: event as u8,
|
||||
value,
|
||||
|
||||
@ -21,7 +21,7 @@ pub struct CHeadRot {
|
||||
|
||||
impl CHeadRot {
|
||||
#[must_use]
|
||||
pub fn new(entity_id: VarInt, head_yaw: u8) -> Self {
|
||||
pub const fn new(entity_id: VarInt, head_yaw: u8) -> Self {
|
||||
Self {
|
||||
entity_id,
|
||||
head_yaw,
|
||||
|
||||
@ -21,7 +21,7 @@ pub struct CHurtAnimation {
|
||||
|
||||
impl CHurtAnimation {
|
||||
#[must_use]
|
||||
pub fn new(entity_id: VarInt, yaw: f32) -> Self {
|
||||
pub const fn new(entity_id: VarInt, yaw: f32) -> Self {
|
||||
Self { entity_id, yaw }
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ pub struct CInitializeWorldBorder {
|
||||
impl CInitializeWorldBorder {
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
x: f64,
|
||||
z: f64,
|
||||
old_diameter: f64,
|
||||
|
||||
@ -18,7 +18,7 @@ pub struct CKeepAlive {
|
||||
|
||||
impl CKeepAlive {
|
||||
#[must_use]
|
||||
pub fn new(keep_alive_id: i64) -> Self {
|
||||
pub const fn new(keep_alive_id: i64) -> Self {
|
||||
Self { keep_alive_id }
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,7 +27,12 @@ pub struct CLevelEvent {
|
||||
|
||||
impl CLevelEvent {
|
||||
#[must_use]
|
||||
pub fn new(event: i32, location: BlockPos, data: i32, disable_relative_volume: bool) -> Self {
|
||||
pub const fn new(
|
||||
event: i32,
|
||||
location: BlockPos,
|
||||
data: i32,
|
||||
disable_relative_volume: bool,
|
||||
) -> Self {
|
||||
Self {
|
||||
event,
|
||||
location,
|
||||
|
||||
@ -56,7 +56,7 @@ impl<'a> CLogin<'a> {
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
#[expect(clippy::fn_params_excessive_bools)]
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
entity_id: i32,
|
||||
is_hardcore: bool,
|
||||
dimension_names: &'a [ResourceLocation],
|
||||
|
||||
@ -28,7 +28,11 @@ pub struct COpenScreen<'a> {
|
||||
|
||||
impl<'a> COpenScreen<'a> {
|
||||
#[must_use]
|
||||
pub fn new(window_id: VarInt, window_type: VarInt, window_title: &'a TextComponent) -> Self {
|
||||
pub const fn new(
|
||||
window_id: VarInt,
|
||||
window_type: VarInt,
|
||||
window_title: &'a TextComponent,
|
||||
) -> Self {
|
||||
Self {
|
||||
sync_id: window_id,
|
||||
window_type,
|
||||
|
||||
@ -20,7 +20,7 @@ pub struct COpenSignEditor {
|
||||
|
||||
impl COpenSignEditor {
|
||||
#[must_use]
|
||||
pub fn new(location: BlockPos, is_front_text: bool) -> Self {
|
||||
pub const fn new(location: BlockPos, is_front_text: bool) -> Self {
|
||||
Self {
|
||||
location,
|
||||
is_front_text,
|
||||
|
||||
@ -39,7 +39,7 @@ pub struct CParticle<'a> {
|
||||
impl<'a> CParticle<'a> {
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
force_spawn: bool,
|
||||
important: bool,
|
||||
position: Vector3<f64>,
|
||||
|
||||
@ -13,7 +13,7 @@ pub struct CPingResponse {
|
||||
|
||||
impl CPingResponse {
|
||||
#[must_use]
|
||||
pub fn new(payload: i64) -> Self {
|
||||
pub const fn new(payload: i64) -> Self {
|
||||
Self { payload }
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ pub struct CPlayerAbilities {
|
||||
|
||||
impl CPlayerAbilities {
|
||||
#[must_use]
|
||||
pub fn new(flags: i8, flying_speed: f32, field_of_view: f32) -> Self {
|
||||
pub const fn new(flags: i8, flying_speed: f32, field_of_view: f32) -> Self {
|
||||
Self {
|
||||
flags,
|
||||
flying_speed,
|
||||
|
||||
@ -53,7 +53,7 @@ pub struct CPlayerChatMessage {
|
||||
impl CPlayerChatMessage {
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
global_index: VarInt,
|
||||
sender: uuid::Uuid,
|
||||
index: VarInt,
|
||||
|
||||
@ -56,7 +56,7 @@ pub struct Player<'a> {
|
||||
|
||||
impl<'a> CPlayerInfoUpdate<'a> {
|
||||
#[must_use]
|
||||
pub fn new(actions: u8, players: &'a [Player<'a>]) -> Self {
|
||||
pub const fn new(actions: u8, players: &'a [Player<'a>]) -> Self {
|
||||
Self { actions, players }
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ pub struct CPlayerPosition {
|
||||
|
||||
impl CPlayerPosition {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
teleport_id: VarInt,
|
||||
position: Vector3<f64>,
|
||||
delta: Vector3<f64>,
|
||||
|
||||
@ -19,7 +19,7 @@ pub struct CRemovePlayerInfo<'a> {
|
||||
|
||||
impl<'a> CRemovePlayerInfo<'a> {
|
||||
#[must_use]
|
||||
pub fn new(players: &'a [uuid::Uuid]) -> Self {
|
||||
pub const fn new(players: &'a [uuid::Uuid]) -> Self {
|
||||
Self { players }
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ pub struct CPlayerSpawnPosition {
|
||||
|
||||
impl CPlayerSpawnPosition {
|
||||
#[must_use]
|
||||
pub fn new(location: BlockPos, yaw: f32, pitch: f32, dimension_name: String) -> Self {
|
||||
pub const fn new(location: BlockPos, yaw: f32, pitch: f32, dimension_name: String) -> Self {
|
||||
Self {
|
||||
dimension_name,
|
||||
location,
|
||||
|
||||
@ -17,7 +17,7 @@ pub struct CRemoveEntities<'a> {
|
||||
|
||||
impl<'a> CRemoveEntities<'a> {
|
||||
#[must_use]
|
||||
pub fn new(entity_ids: &'a [VarInt]) -> Self {
|
||||
pub const fn new(entity_ids: &'a [VarInt]) -> Self {
|
||||
Self { entity_ids }
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ pub struct CRemoveMobEffect {
|
||||
|
||||
impl CRemoveMobEffect {
|
||||
#[must_use]
|
||||
pub fn new(entity_id: VarInt, effect_id: VarInt) -> Self {
|
||||
pub const fn new(entity_id: VarInt, effect_id: VarInt) -> Self {
|
||||
Self {
|
||||
entity_id,
|
||||
effect_id,
|
||||
|
||||
@ -11,7 +11,7 @@ pub struct CResetScore {
|
||||
|
||||
impl CResetScore {
|
||||
#[must_use]
|
||||
pub fn new(entity_name: String, objective_name: Option<String>) -> Self {
|
||||
pub const fn new(entity_name: String, objective_name: Option<String>) -> Self {
|
||||
Self {
|
||||
entity_name,
|
||||
objective_name,
|
||||
|
||||
@ -24,7 +24,7 @@ pub struct CRespawn {
|
||||
impl CRespawn {
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
pub const fn new(
|
||||
dimension_type: VarInt,
|
||||
dimension_name: ResourceLocation,
|
||||
hashed_seed: i64,
|
||||
|
||||
@ -11,7 +11,7 @@ pub struct CPlayServerLinks<'a> {
|
||||
|
||||
impl<'a> CPlayServerLinks<'a> {
|
||||
#[must_use]
|
||||
pub fn new(links: &'a [Link<'a>]) -> Self {
|
||||
pub const fn new(links: &'a [Link<'a>]) -> Self {
|
||||
Self { links }
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ pub struct CSetBorderCenter {
|
||||
|
||||
impl CSetBorderCenter {
|
||||
#[must_use]
|
||||
pub fn new(x: f64, z: f64) -> Self {
|
||||
pub const fn new(x: f64, z: f64) -> Self {
|
||||
Self { x, z }
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ pub struct CSetBorderLerpSize {
|
||||
|
||||
impl CSetBorderLerpSize {
|
||||
#[must_use]
|
||||
pub fn new(old_diameter: f64, new_diameter: f64, speed: VarLong) -> Self {
|
||||
pub const fn new(old_diameter: f64, new_diameter: f64, speed: VarLong) -> Self {
|
||||
Self {
|
||||
old_diameter,
|
||||
new_diameter,
|
||||
|
||||
@ -10,7 +10,7 @@ pub struct CSetBorderSize {
|
||||
|
||||
impl CSetBorderSize {
|
||||
#[must_use]
|
||||
pub fn new(diameter: f64) -> Self {
|
||||
pub const fn new(diameter: f64) -> Self {
|
||||
Self { diameter }
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ pub struct CSetBorderWarningDelay {
|
||||
|
||||
impl CSetBorderWarningDelay {
|
||||
#[must_use]
|
||||
pub fn new(warning_time: VarInt) -> Self {
|
||||
pub const fn new(warning_time: VarInt) -> Self {
|
||||
Self { warning_time }
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user