2021: bump bitvec to 1.0

This commit is contained in:
Antoine Martin 2022-12-05 23:04:07 +01:00
parent f3f3b40d47
commit 8e1328571b
3 changed files with 12 additions and 12 deletions

16
Cargo.lock generated
View file

@ -141,9 +141,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitvec"
version = "0.22.3"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5237f00a8c86130a0cc317830e558b966dd7850d48a953d998c813f01a41b527"
checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
dependencies = [
"funty",
"radium",
@ -347,9 +347,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "funty"
version = "1.2.0"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e"
checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
[[package]]
name = "generic-array"
@ -574,9 +574,9 @@ dependencies = [
[[package]]
name = "radium"
version = "0.6.2"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb"
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
[[package]]
name = "rand"
@ -912,9 +912,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "wyz"
version = "0.4.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "129e027ad65ce1453680623c3fb5163cbf7107bfe1aa32257e7d0e63f9ced188"
checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
dependencies = [
"tap",
]

View file

@ -10,7 +10,7 @@ edition = "2021"
aoc = { path = "../aoc" }
anyhow = "1.0"
rand = "0.8"
bitvec = "0.22"
bitvec = "1.0"
[lib]
path = "src/lib.rs"

View file

@ -122,7 +122,7 @@ impl std::str::FromStr for Packet {
fn from_str(s: &str) -> Result<Self> {
let s = s.trim();
let mut bits = BitVec::<Msb0, usize>::new();
let mut bits = BitVec::<usize, Msb0>::new();
bits.resize(4 * s.len(), false);
for (i, c) in s.chars().enumerate() {
@ -149,13 +149,13 @@ const TLID1_SUBPACKET_NUMBER_BITS: usize = 11;
const SUBPACKET_START_INDEX_TLID1: usize = LENGTH_INDEX + TLID1_SUBPACKET_NUMBER_BITS;
const SUBPACKETS_NUMBER_RANGE: Range<usize> = LENGTH_INDEX..SUBPACKET_START_INDEX_TLID1;
impl<'bits, Store> TryFrom<&'bits BitSlice<Msb0, Store>> for Packet
impl<'bits, Store> TryFrom<&'bits BitSlice<Store, Msb0>> for Packet
where
Store: BitStore,
{
type Error = anyhow::Error;
fn try_from(bits: &'bits BitSlice<Msb0, Store>) -> Result<Self> {
fn try_from(bits: &'bits BitSlice<Store, Msb0>) -> Result<Self> {
let version: u8 = bits[VERSION_RANGE].load_be();
let type_id: u8 = bits[TYPE_ID_RANGE].load_be();