1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 16:44:06 +02:00

prepare for 0.11

This commit is contained in:
Robin Appelman 2023-10-09 21:51:46 +02:00
commit 417e8c2b96
4 changed files with 74 additions and 92 deletions

136
Cargo.lock generated
View file

@ -10,10 +10,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]] [[package]]
name = "bitbuffer" name = "bitbuffer"
version = "0.10.9" version = "0.11.0"
dependencies = [ dependencies = [
"bitbuffer_derive", "bitbuffer_derive",
"err-derive",
"iai", "iai",
"maplit", "maplit",
"memchr", "memchr",
@ -21,18 +20,19 @@ dependencies = [
"schemars", "schemars",
"serde", "serde",
"serde_json", "serde_json",
"thiserror",
] ]
[[package]] [[package]]
name = "bitbuffer_derive" name = "bitbuffer_derive"
version = "0.10.1" version = "0.11.0"
dependencies = [ dependencies = [
"bitbuffer", "bitbuffer",
"merge", "merge",
"proc-macro2", "proc-macro2",
"quote", "quote",
"structmeta", "structmeta",
"syn 2.0.22", "syn 2.0.38",
] ]
[[package]] [[package]]
@ -41,20 +41,6 @@ version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28"
[[package]]
name = "err-derive"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c34a887c8df3ed90498c1c437ce21f211c8e27672921a8ffa293cb8d6d4caa9e"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"rustversion",
"syn 1.0.92",
"synstructure",
]
[[package]] [[package]]
name = "iai" name = "iai"
version = "0.1.1" version = "0.1.1"
@ -75,9 +61,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.5.0" version = "2.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
[[package]] [[package]]
name = "merge" name = "merge"
@ -98,14 +84,14 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.92", "syn 1.0.109",
] ]
[[package]] [[package]]
name = "num-traits" name = "num-traits"
version = "0.2.14" version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
dependencies = [ dependencies = [
"autocfg", "autocfg",
] ]
@ -119,7 +105,7 @@ dependencies = [
"proc-macro-error-attr", "proc-macro-error-attr",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.92", "syn 1.0.109",
"version_check", "version_check",
] ]
@ -136,28 +122,22 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.63" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.29" version = "1.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]]
name = "rustversion"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.9" version = "1.0.9"
@ -166,9 +146,9 @@ checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
[[package]] [[package]]
name = "schemars" name = "schemars"
version = "0.8.8" version = "0.8.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6b5a3c80cea1ab61f4260238409510e814e38b4b563c06044edf91e7dc070e3" checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c"
dependencies = [ dependencies = [
"dyn-clone", "dyn-clone",
"schemars_derive", "schemars_derive",
@ -178,52 +158,52 @@ dependencies = [
[[package]] [[package]]
name = "schemars_derive" name = "schemars_derive"
version = "0.8.8" version = "0.8.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41ae4dce13e8614c46ac3c38ef1c0d668b101df6ac39817aebdaa26642ddae9b" checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals", "serde_derive_internals",
"syn 1.0.92", "syn 1.0.109",
] ]
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.137" version = "1.0.188"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.137" version = "1.0.188"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.92", "syn 2.0.38",
] ]
[[package]] [[package]]
name = "serde_derive_internals" name = "serde_derive_internals"
version = "0.25.0" version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.92", "syn 1.0.109",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.80" version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f972498cf015f7c0746cac89ebe1d6ef10c293b94175a243a2d9442c163d9944" checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65"
dependencies = [ dependencies = [
"itoa", "itoa",
"ryu", "ryu",
@ -239,7 +219,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"structmeta-derive", "structmeta-derive",
"syn 2.0.22", "syn 2.0.38",
] ]
[[package]] [[package]]
@ -250,25 +230,14 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.22", "syn 2.0.38",
] ]
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.92" version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
]
[[package]]
name = "syn"
version = "2.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -276,28 +245,41 @@ dependencies = [
] ]
[[package]] [[package]]
name = "synstructure" name = "syn"
version = "0.12.6" version = "2.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.92", "unicode-ident",
"unicode-xid", ]
[[package]]
name = "thiserror"
version = "1.0.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.38",
] ]
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.9" version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
[[package]]
name = "unicode-xid"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]] [[package]]
name = "version_check" name = "version_check"

View file

@ -1,25 +1,25 @@
[package] [package]
name = "bitbuffer" name = "bitbuffer"
version = "0.10.9" version = "0.11.0"
authors = ["Robin Appelman <robin@icewind.nl>"] authors = ["Robin Appelman <robin@icewind.nl>"]
edition = "2021" edition = "2021"
description = "Reading bit sequences from a byte slice" description = "Reading bit sequences from a byte slice"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
repository = "https://github.com/icewind1991/bitbuffer" repository = "https://github.com/icewind1991/bitbuffer"
rust-version = "1.56.0" rust-version = "1.65.0"
[dependencies] [dependencies]
num-traits = "0.2" num-traits = "0.2.17"
err-derive = "0.3" thiserror = "1.0.49"
bitbuffer_derive = { version = "0.10", path = "bitbuffer_derive" } bitbuffer_derive = { version = "0.11.0", path = "bitbuffer_derive" }
memchr = "2" memchr = "2.6.4"
serde = { version = "1", features = ["derive"], optional = true } serde = { version = "1.0.188", features = ["derive"], optional = true }
schemars = { version = "0.8", optional = true } schemars = { version = "0.8.15", optional = true }
[dev-dependencies] [dev-dependencies]
maplit = "1" maplit = "1.0.2"
iai = "0.1" iai = "0.1.1"
serde_json = "1" serde_json = "1.0.107"
[[bench]] [[bench]]
name = "bench" name = "bench"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "bitbuffer_derive" name = "bitbuffer_derive"
version = "0.10.1" version = "0.11.0"
authors = ["Robin Appelman <robin@icewind.nl>"] authors = ["Robin Appelman <robin@icewind.nl>"]
edition = "2018" edition = "2018"
description = "Reading bit sequences from a byte slice" description = "Reading bit sequences from a byte slice"
@ -12,11 +12,11 @@ name = "bitbuffer_derive"
proc-macro = true proc-macro = true
[dependencies] [dependencies]
syn = { version = "2.0.22", features = ["extra-traits"] } syn = { version = "2.0.38", features = ["extra-traits"] }
quote = "1.0.29" quote = "1.0.33"
proc-macro2 = "1.0.63" proc-macro2 = "1.0.69"
structmeta = "0.2.0" structmeta = "0.2.0"
merge = "0.1.0" merge = "0.1.0"
[dev-dependencies] [dev-dependencies]
bitbuffer = { version = "0.10", path = ".." } bitbuffer = { version = "0.11", path = ".." }

View file

@ -75,7 +75,7 @@
#![warn(missing_docs)] #![warn(missing_docs)]
use err_derive::Error; use thiserror::Error;
pub use bitbuffer_derive::{BitRead, BitReadSized, BitWrite, BitWriteSized}; pub use bitbuffer_derive::{BitRead, BitReadSized, BitWrite, BitWriteSized};
pub use endianness::*; pub use endianness::*;
@ -101,7 +101,7 @@ mod writestream;
pub enum BitError { pub enum BitError {
/// Too many bits requested to fit in the requested data type /// Too many bits requested to fit in the requested data type
#[error( #[error(
display = "Too many bits requested to fit in the requested data type, requested to read {} bits while only {} fit in the datatype", "Too many bits requested to fit in the requested data type, requested to read {} bits while only {} fit in the datatype",
requested, requested,
max max
)] )]
@ -113,7 +113,7 @@ pub enum BitError {
}, },
/// Not enough data in the buffer to read all requested bits /// Not enough data in the buffer to read all requested bits
#[error( #[error(
display = "Not enough data in the buffer to read all requested bits, requested to read {} bits while only {} bits are left", "Not enough data in the buffer to read all requested bits, requested to read {} bits while only {} bits are left",
requested, requested,
bits_left bits_left
)] )]
@ -125,7 +125,7 @@ pub enum BitError {
}, },
/// The requested position is outside the bounds of the stream or buffer /// The requested position is outside the bounds of the stream or buffer
#[error( #[error(
display = "The requested position is outside the bounds of the stream, requested position {} while the stream or buffer is only {} bits long", "The requested position is outside the bounds of the stream, requested position {} while the stream or buffer is only {} bits long",
pos, pos,
size size
)] )]
@ -137,7 +137,7 @@ pub enum BitError {
}, },
/// Unmatched discriminant found while trying to read an enum /// Unmatched discriminant found while trying to read an enum
#[error( #[error(
display = "Unmatched discriminant '{}' found while trying to read enum '{}'", "Unmatched discriminant '{}' found while trying to read enum '{}'",
discriminant, discriminant,
enum_name enum_name
)] )]
@ -148,11 +148,11 @@ pub enum BitError {
enum_name: String, enum_name: String,
}, },
/// The read slice of bytes are not valid utf8 /// The read slice of bytes are not valid utf8
#[error(display = "The read slice of bytes are not valid utf8: {}", _0)] #[error("The read slice of bytes are not valid utf8: {}", _0)]
Utf8Error(Utf8Error, usize), Utf8Error(Utf8Error, usize),
/// The string that was requested to be written does not fit in the specified fixed length /// The string that was requested to be written does not fit in the specified fixed length
#[error( #[error(
display = "The string that was requested to be written does not fit in the specified fixed length, string is {} bytes long, while a size of {} has been specified", "The string that was requested to be written does not fit in the specified fixed length, string is {} bytes long, while a size of {} has been specified",
string_length, string_length,
requested_length requested_length
)] )]